I have some html code which is loaded by reading some json. Inside that data there are some links.
I need to add onclick="myfunction();" to the anchors of these links.
As I don’t want any other links to be changed I have added a class to all internal link (Links which are not imported).
What I need is some jquery which would do this:
IF Links have not go class="internal" then add onclick=”myfunction();”**
So if link looks like:
<a href="" class="internal">Click me</a>
then nothing is done
but if it’s like this:
<a href="">Click me</a>
then it’s changed to this:
<a href="" onclick="myfunction();">Click me</a>
How can I do this?
Use the
notpsuedoselector: