Home > front end >  JavaScript label attribute values
JavaScript label attribute values

Time:11-01

Why can't get selected? Bosses last time to do all the selected is also can't get checked

CodePudding user response:

You have selected this attribute not debugging look down

CodePudding user response:

Error message option does not exist

CodePudding user response:

reference 1st floor usecf response:
you have selected the properties under debug not

can print out the true or false

CodePudding user response:

for (var I=0; I & lt; SSL. Children. Length; I++) {

CodePudding user response:

Use SSL directly. The value, the document. The getElementById (" you select ID "). The value

CodePudding user response:

Right without #?

CodePudding user response:

reference 5 floor xumei_ reply:
with SSL directly. The value of the document. The getElementById (" you select ID "). The value
tag is not the value attribute values is

CodePudding user response:

reference 1st floor usecf response:
you have selected the properties under debug not
console can print out the true and false

CodePudding user response:

refer to 6th floor LN8888 response:
right without #?
why add # of this

CodePudding user response:

$(" # sil "). The find (" option: selected ")

CodePudding user response:

For (var I=0; SSL. Children. Length; I++)

For loop is not defined cycle constraints, so I have been on the increase, and over SSL. The number of children, resulting in SSL. Children [I] as undifined, causing an error

CodePudding user response:

The for loop write wrong

CodePudding user response:

references 9 f weixin_45508406 response:
Quote: refer to the sixth floor LN8888 response:
right without #?
why want to add # of this
id # don't need to add this?

CodePudding user response:

You got mixed up on the Javascript and Jquery, Jquery when acquiring the ID $(" # ID attribute values "), the function should be
Such as & lt; Input the id="input"/& gt;
$(" # input "). Click (function () {
})
Javascript is
Document. The getElementById (" attribute ID value "). The onclick=function () {
}
SSL. The other children [I] value, should be like this

CodePudding user response:

The for loop is write wrong

CodePudding user response:

You this problem is not a bit

CodePudding user response:

My train of thought is to get to all the op, traverse the op label set, and then if selected conditions are met, is to specify the direction, you use jquery to obtain all the word tag, assign a value to a variable, in the for loop iterates through this variable, remember and circulation condition, or an infinite loop, then add try judge conditions in the loop, I haven't seen this kind of writing, I know how to write using jquery, is also a novice huh

CodePudding user response:

The for loop, should not be i CodePudding user response:

On the 14th floor mary_123789
reference response:
you got mixed up on the Javascript and Jquery, Jquery when acquiring the ID $(" # ID attribute values "), the function should be
Such as & lt; Input the id="input"/& gt;
$(" # input "). Click (function () {
})
Javascript is
Document. The getElementById (" attribute ID value "). The onclick=function () {
}
SSL. The other children [I] value, should be so
that is written by myself a obtain the element function

CodePudding user response:

Why have children, this will make text wrapping also into an element, use.childnodes

CodePudding user response:

Sweat,,,, wrong,,,

Well, you all say upstairs, the loop body
  • Related