0

I'm parsing an html document with jQuery using $.ajax and I have the following problem, some divs have some uncommon attributes as you can see:
<div id='img' title='blabla' no='number' src='smthin'>content</div>
But the problem is that ajax only output:
<div id='img' title='blalba' src='smthin'>
The no attribute is skipped, how can I solve it ?

Darrrky89
  • 141
  • 4
  • 7
  • Perhaps relevant: http://stackoverflow.com/questions/9684323/non-existing-attributes-html-input-field – jimw Apr 12 '12 at 21:51

3 Answers3

1

you should use data- prefix for user-defined attributes in HTML tags. Try usind data-no instead of no attribute.

Naigel
  • 9,086
  • 16
  • 65
  • 106
0

Not sure if I have enough info: http://jsfiddle.net/mikevoermans/yEREC/

The fiddle seems to keep the attributes.

mikevoermans
  • 3,967
  • 22
  • 27
0

try (if possible) to use data attributes http://html5doctor.com/html5-custom-data-attributes/