I have a table with mutiple div tags inside a td tag and I want to get the text value of the div using jquery
A
R
A
Denied
>
I want to do
if(the div text == "A")
{
show all the tr with the div tags with "A" inside the td
}
Any help will be appreciated
Tuhin PaulPosted May 1, 2023, 6:50 PM
See the code, this code will show all tr elements that contain a div element with text "A" inside a td element of the table:
Tuhin PaulPosted May 1, 2023, 6:48 PM
You can use jQuery to iterate through all the
divelements within thetdelements of the table, and check the text content of eachdivelement.Deepak RawatPosted Apr 30, 2023, 1:17 PM
the jQuery code loops through each
tdelement and finds thedivelement with classmy-divinside it using thefind()method. It then gets the text value of eachdivelement using thetext()method and logs it to the console. You can modify the code to suit your specific use case.Ali BenchaabanPosted Mar 22, 2023, 11:41 PM
To get the value of div content in jQuery, use the text() method