I have printed an echo with php of input element and I need to get click event id using jquery. Below is the code I am trying to get
API.php(echo element to index.php using ajax):
echo"<input type='submit' id='something' value='accept me'/>";
index.php(need to get the id='something' in click event):
$("#something").click(function(){
alert("hi");
//doesnt work
});
why it is not working? Please suggest