3 ms·
i might be missing something, but what is gained by using jquery? just use one line of jscript to replace the button with some text.
by ashishk 17y ago
i might be missing something, but what is gained by using jquery? just use one line of jscript to replace the button with some text.
- treyp 17y agoyou're right about this. maybe just because it's readable and so many people already have jquery on their site. and i prefer just disabling the button $('input:submit',this).attr('disabled','disabled'); than replacing it with a paragraph, but it's up to you.
- seasoup 17y agoYou wouldn't use jQuery just to replace a button with some text on form submission. It's a big framework to load for something that small, but if you are already using jQuery then this link shows how to do it in jQuery.
- jasonkester 17y agoThat was my thought too. Why would I import somebody's 3rd party library to save myself typing document.getElementById once on this page? I'm sure jquery has its advantages for some things. Silly little javascript tricks like this don't seem to me like they qualify.
- briancray 17y agoReally great points about javascript everyone! I guess I figured it was better to show how to do it with jQuery because many people are interested in jQuery, and this code snippet gives them an extra idea how jQuery works. Thanks so much for your feedback!