Possible Duplicate:
How to use a variable in place of ID in jquery
I have the function called makeinvisible and one of the parameters is supposed to be a jQuery id selector for an image with id=testimage. JavaScript does not recognize it as such, hence the image does not become hidden.
function makeinvisible (imageid){
$("#imageid").css("visibility","hidden")
}
$(document).ready(
makeinvisible("testimage")
)
Any help appreciated!
The code as written is looking for an element with id=imageid.
Try:
Edit: Your document.ready call is also incorrect. The way you have it written makeinvisible is being executed immediately, not on document ready. It needs to be: