I am new to Jquery. I have an upload form that when something is uploaded the upload-button changes class from:
<a class="upload-button upload buy" id="upload-button"><span>Upload a document</span></a>
To:
<a class="upload-button buy white" id="upload-button"><span>Upload a document</span></a>
I have tried to write a function that adds a div called ‘done’ if a file has already been uploaded(the class in the button has changed).
Here is what I have got so far:
$('a#upload-button').ready(function() {
if ($(this).hasClass('white')) {
$('#three')
.append('<div class="done rotateone wiggler"></div>')
.addClass('grey');
}
})
I am not sure why it is not working. Please could somebody help?
You should do (if you want to check if a button has a class when the page is loaded, otherwise just take the
ifpart and put it where you need itEDIT – you should modify your script