Hi
I am trying to change the type of <input> from submit to image using jquery so that the image is displayed during the AJAX request instead of the button. I am doing:
$(document).ajaxStart(function(){$("#submit_btn").removeAttr("type").attr("image");});
and my HTML is:
<input type="submit" name="submit" class="button" id="submit_btn" value="Send" src="images/sending.gif" />
Am I doing it the right away? And if so, what’s wrong because this ain’t working :p
I think you’re looking for:
Using
attr()to set the attribute, rather than removing it.