给定 HTML 片段
<img id="progress" src="http://ajaxify.com/run/sum/progress/progress.gif" class="notWaiting"/>
传统 JavaScript 方式,
function submitWord() {
// Show progress indicator and clear existing results
$("progress").classname="waiting";
但以下的代码却行不通:
function submitWord() {
// Show progress indicator and clear existing results
$("#progress").toggleClass("notWaiting waiting");
此外,我还尝试了addClass ,甚至做了类似的事情。
$("#progress").removeClass().addClass("waiting");
只是为了确保先删除默认类,但... ain t 也帮助。
UPDATE: here is the JSfiddle version. http://jsfiddle.net/EVbh2/1/
UPDATE 2:
Now the problem above was that i dint refer to JQuery file itself . But still i am facing problems with code . I tried converting all the code into jquery but it aint working .
here is a new FIDDLE.