小编Com*_*rit的帖子

单击带有量角器的复选框?

HTML代码

<div class="check-box-panel">
<!--
 ngRepeat: employee in employees 
-->
<div class="ng-scope" ng-repeat="employee in employees">
    <div class="action-checkbox ng-binding">
        <input id="John" type="checkbox" ng-click="toggleSelection(employee.name)" 
                   ng-checked="selection.indexOf(employee.name) > -1" value="John"></input>

    <label for="John">
        ::before
    </label>
<!--
 John               
 end ngRepeat: employee in employees 
-->

<div class="ng-scope" ng-repeat="employee in employees">
<div class="action-checkbox ng-binding">
    <input id="Jessie" type="checkbox" ng-click="toggleSelection(employee.name)" 
               ng-checked="selection.indexOf(employee.name) > -1" value="Jessie"></input>

    <label for="Jessie"></label>
Run Code Online (Sandbox Code Playgroud)

我尝试使用jQuery

element(by.repeater('employee in employees')).element(by.id('Jessie')).click();
Run Code Online (Sandbox Code Playgroud)

另外,我尝试使用CSS

element(by.repeater('employee in employees')).$('[value="Jessie"]').click();
Run Code Online (Sandbox Code Playgroud)

但它没有完成这项工作.我可以点击特定的复选框的任何其他方式?

javascript css angularjs protractor

4
推荐指数
2
解决办法
2万
查看次数

为什么此C程序的输出是64,而不是320?

#include <stdio.h>

int main() {
    int a = 320;
    char *ptr;

    ptr = (char *)&a;
    printf("%d", *ptr);

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

我期望输出是,320但是我得到了64。这是什么原因呢?

c pointers dereference

3
推荐指数
1
解决办法
88
查看次数

复制没有strcpy的字符串

#include <stdio.h>
#include <stdlib.h>

int main() {
    char *str, *temp;
    str = malloc(sizeof(char) * 100);
    fgets(str, 100, stdin);
    temp = str;
    printf("%s", str);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

这个有效的代码是不使用strcpy()函数将一个字符串复制到另一个字符串

c string pointers dereference

2
推荐指数
1
解决办法
109
查看次数

标签 统计

c ×2

dereference ×2

pointers ×2

angularjs ×1

css ×1

javascript ×1

protractor ×1

string ×1