badwolfff
asked on
How do I insert a piece of html code inside an html tag using jquery?
Hi,
I have a line of HTML code as follows:
I would like to insert the following code before ">CLICK":
so that the result is like this:
I am using jQuery. How do I achieve this?
thanks in advance
I have a line of HTML code as follows:
<a href="test.html" title="home">CLICK</a>
I would like to insert the following code before ">CLICK":
data-tip="Pause Video" href="javascript:void(0);" onclick="pauseBgVideo();"
so that the result is like this:
<a href="test.html" title="home" data-tip="Pause Video" href="javascript:void(0);" onclick="pauseBgVideo();">CLICK</a>
I am using jQuery. How do I achieve this?
thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your 'result' has two 'href's and that's an error.
I was talking about the original post.
ASKER
I've tried the code and it doesn't work.
I've left it on the site for the moment.
I am trying to see if I can find a workaround too.
thanks
I've left it on the site for the moment.
I am trying to see if I can find a workaround too.
thanks