html - Can jQuery select elements with IDs that start similarly? -
I have multiple comment IDs that I want to reset to a default value.
Ex:
& lt; An id = "comments_inner_toggle_45" & gt; Example 1 & lt; / A & gt; & Lt; An id = "comments_inner_toggle_608" & gt; Example 2 & lt; / A & gt; & Lt; An id = "comments_inner_toggle_28" & gt; Example 3 & lt; / A & gt; ...
How can I write the correct tag on jQuery and take some action on it to select every tag with an id of "tags_inner_toggle_"?
I think this is something like this:
$ ('a [id | = comments_inner_toggle _]').
This is incorrect, but because the above code only matches the tag with "Comments_inner_toggle_" and does not end with the attached number. How do I fix it? Thanks for the help! :)
$ ('a [id ^ = comments_inner_toggle _]').
The carat selector starts to mean. | It means or starts with it and has a hyphen.
Comments
Post a Comment