Why below code does not work:
$('button[name="publish"]', 'button[name="cancel"]').live('click', function(){
alert('ddddd');
});
The html is generated dynamically which is basically facebook’s Share dialog which has these two buttons:
<input type="button" name="publish" value="Share">
<input type="button" name="cancel" value="Cancel">
- Reference to jQuery lib is fine and checked
- Using ready handler
The page can be viewed here:
Your current selector is short for:
That’s not intended. You’re looking for: