Home > front end > Expert guidance: jquery can set a value for the text box? Why can't set value to change after?
Expert guidance: jquery can set a value for the text box? Why can't set value to change after?
Time:09-17
Search & lt;/title>
& nbsp;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- The inside of the above HTML: & lt; Input autocomplete="off" type="text" size="10"... Jquery can only set a value for the text box? Why can't set value to change after? I use $(" # GSC - I - id1 "). The attr (" value ", "GGG"); Inside a web page can see set in, but I'll change a value, yyy, the text frame's value is still GGG, why?
Another strange question, I have the text of the button, use jQuery to click operation, the following: $(' GSC - search - button GSC - search - button - v2 '). Click (); Not working? Why is that?
CodePudding user response:
May be the first time you set the GSC - I - after id1, other code (such as a js framework or js plug-in) for # GSC - I - id1 elements for the replacement,
Through multiple class name when choosing elements, each in front of the class name to add ". "and there can be no Spaces between the space becomes the descendant combinator, $('. The GSC - search - button. GSC - search - button - v2 '). Click ();