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 ?
Asked
Active
Viewed 62 times
0

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 Answers
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
-
The problem is that the parser don't give me the attributes, if they were here, I could parse it. – Darrrky89 Apr 12 '12 at 22:31
0
try (if possible) to use data attributes http://html5doctor.com/html5-custom-data-attributes/

Enrique Acevedo
- 51
- 4