I need to get the name of a bootstrap nav when I click it using jquery or javascript. That is all, is a simple question.
I'm not sure what you mean by name
but try the following code :
$('.navbar-nav').on('click', 'a', function(){
$(this).text(); //To get the display text
$(this).attr('name'); //if you mean attribute name
});
Hope this helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.