142
rated 0 times
[
143]
[
1]
/ answers: 1 / hits: 22418
/ 15 Years ago, mon, august 3, 2009, 12:00:00
Classic javascript:
var myvar = document.getElementById(abc);
abc.value += test;
abc.value += another test;
Jquery:
$(#abc).val($(#abc).val()+test);
$(#abc).val($(#abc).val()+another test);
Is there a way to make my Jquery prettier, maybe with a hidden += function that I could use? I know that .val() is not an attribute, but I feel there must be a way to make this code more beautiful to look at...
Something like this would be great:
$(#abc).valueAttribute += test
$(#abc).val().content += test
$(#abc).val().add(test)
More From » jquery