I’m having a problem trying to make this additemtolist fuction to work, the id=clickitemtoadd is a list loaded dynamicly with avalible items. but because is Dynamic load is not working.
Here is the code for onclick
call a function:
function additemtolist(pos_name,item_id,pos_value){
alert('clicked')
}
<p id="clickitemtoadd" onclick="additemtolist('item name','item id','item sales value')">item name</p>
2
Answers
I found a work around solution for someone with this problem
Script:
html:
use live instead of inlinedeprecatedonclick
.Use Delegated event handlers :