Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
Monday, January 11, 2016
$(document).on('click', check which class is clicked for multiple classes
For example, jquery, click:
$(document).on('click', '.sendmail00, .sendmailq',function(){
I want to check which class is clicked? .sendmail00 or .sendmailq?
We can check its parent to contain this class or not.
Examples, suppose both of classes have parents td,
$(document).on('click', '.sendmail00, .sendmailq',function(){
var $td = $(this).parents('td');
if($td.find('.sendmailq').html()==null ||$td.find('.sendmailq').html()==undefined)
alert('Not contain class .sendmailq');
else
alert('Contain class .sendmailq');
});
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment