I am using jQuery hide()
function to hide an element in two situations. One is the normal situation and it is working there. The other situation is that the part that contains the element is loaded through AJAX. I have written the script in the page to which the content is loaded to. But in this case, the function is not working. I have given the function in onclick
. The click is triggered, but it is not hiding the element. As the click is triggered, I think there is no need to use live()
My element code is as follows :
<input type="button" onclick="addMoreElements(this.id);" value="Add" id="406" class="button">
and in the addMoreElements function I have
function addMoreElements(currentElement){
$('#406').hide();
}