I have this default jQuery selector (a div element) for matching a specific element:
$('.myselectorid')
However this "myselectorid" appears in different pages of the site. I am thinking if it is possible to add a page title selector to the above original selector so that I could execute my jQuery implementation on a specific page only (specified by the page title).
Also I need all of them combined as one jQuery selector.
I also know that to retrieve the page title, it would be like this:
$('html head title').text();
However I am not sure how to combined the above selector to my original selector as one new selector. For example, supposing I would like it to match the selector on a page with title "This is my page title", can I do it like this?
$('.myselectorid[html head title="This is my page title"]')
If not, how would I do it so that all of them appears as one combined selector (without using .add etc.) and it matches the page title as well?
I'm not an expert of jQuery selectors, I would appreciate if someone can share some insights on this approach. Thanks a lot!