-2

I have a anchor <a></a> with an attribute rel. in the rel value there is html, such as <a rel="html=<div>This is a test</div>. I want to update html inside of rel value, I can update the actual change on the page but if i go to the next slide and come back, its back to what it was before because the rel value is not updated. I am not sure how to go about doing this. Any suggestions, I am using Clearbox by the way.

Example(I know the html is incorrect on here, but it is correct on my page. I just need to know how to update it through jquery or any other way)

<a rel="html=<div class="testclass"> This is a test</div></a>

a piece of the html element (not the a) Needs to be changed to

<a rel="html=<div class="testclass"> No more testing </div></a>
user516883
  • 8,868
  • 23
  • 72
  • 114

2 Answers2

2

You can (But SHOULDN'T) do that with

this.rel = 'html=<div>But you shouldnt do that</div>';

JSFiddle here

Alper
  • 1,085
  • 3
  • 20
  • 39
0

I think you need to avoid the use of double quotes inside another double quotes, if you are using double quotes to wrap a string use single quotes inside that string and vice versa.

See this --> http://jsfiddle.net/Galled/rXKCL/14/

Galled
  • 4,146
  • 2
  • 28
  • 41