Govindarajulu
Govindarajulu

Reputation: 35

Hide the button which is available in p tag which is last of li tag

I am placing three buttons in one li (there are 4 p tags in one li tag) of last p tag. I need to catch the last p tag's second button. Please suggest some solution to do this.

Upvotes: 0

Views: 136

Answers (1)

Gert Grenander
Gert Grenander

Reputation: 17104

This will give you the second button in the last P tag:

$('p:last :button').eq(1).attr("id")

And if you want to hide it:

$('p:last :button').eq(1).attr("id").hide();

Upvotes: 2

Related Questions