Piscean
Piscean

Reputation: 3079

Why am i getting extra html when i use jquery ui autocomplete?

i am generating following html in my web page using jquery.

 <input id="left_div_foretagname" class="userinfofont" type="text" name="left_div_foretagname" />

but when i see html of my page, i get following html:

 <input name="left_div_foretagname" class="userinfofont ui-autocomplete-input" id="left_div_foretagname" role="textbox" aria-haspopup="true" type="text" autocomplete="off" aria-autocomplete="list"/>

i am using jquery ui autocomplete. its not only this element. a lot of elements in my html get these extra attributes. How can i avoid attributes to get this Extra attributes.

Link to jquery ui autocomplete is Following:

 http://jqueryui.com/demos/autocomplete/

Upvotes: 1

Views: 177

Answers (1)

Ryan McDonough
Ryan McDonough

Reputation: 10012

These attributes are added by JQuery UI so you don't have to do them yourself, and so when you upgrade the library over time you don't have to change anything.

They are required in order for it to work in multiple browsers.

You will notice that if you view the source of the demo has the exact same extra attributes added:

<input id="tags" class="ui-autocomplete-input" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true">

Even though the basic source is only:

<input id="tags">

Upvotes: 5

Related Questions