I have a form in my sidebar which is part of a WordPress plugin and I'm not sure where the PHP code builds The form remains, so I want to add a square and a value to the text input using jQuery. I have so far:
$ j ('body'). Find ($ (': # inputfile') ($ (': input # s'). AddClass (' default-value '); $ j (' form # searchform '). (': Input # S ') search. Val (' enter search here ... ');}); The class has been successfully added to HTML, but although it is shown in text input, it has not been added to HTML, i.e. within the tag, which needs to be for my default Is the value script to work, so I'm thinking that there is a way to add value to the inline?
The default value of SCRIPT $ j ('.df default each (function () {var default_value = $ j (this) .val (); $ J (this) .css ('color', '# 837D73'); // It may be in style instead of $ j (this). Focus (function () {if (this.value = = Default_value) {this.value = ''; $ j (this) .css ('color', 'black');}}); $ J (this) .blur (function () {if (this.value = = '') {$ J (this) .css ('color', '# 837D73'); this.value = default_value;}});});
and note
var default_value = this.value; You Instead, you can make your code easier. Pre> $ j ('body'). Ready (work () {$ j ('input #s') .addClass ('default-value') .val ('search here enter ...');});
Comments
Post a Comment