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 开发者_StackOverflow社区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:
$(document).ajaxStart(function(){$("#submit_btn").attr("type","image");});
Using attr()
to set the attribute, rather than removing it.
May be this work for you:
$(document).ajaxStart(function(){$("#submit_btn")..attr(type : 'image');});
精彩评论