I am currently trying to update my website with some jQuery functions. As allways with web development IE is being a pain.
I have an autosuggestion list that looks like this:
<div id="suggestionBox">
<ul>
<li>
<a class="entry" style="display:block;" href="#">somesuggestion</a>
</li>
...
</ul
</div>
Of course, the suggestions are gained from a server, so I use a load() function every time the input field is changed. This works all fine.
The problem is, I want the input field to be completed when a suggestion is clicked.
I use the following code for that:
$(".entry").live('click', function() {
$("#" + $("#suggestionBox").data('input')).val(this.text);
//and some more stuff
});
The data field for the suggestionBox is set when the input field gets focus.
It works perfectly fine in Chrome, and FireFox but not in IE.
this.text in the above code returns undefined.
I have no clue why this shouldn’t work for IE. Can anyone help me?
Thanks.
Why don’t you use jQuery?
An
aelement has notextproperty in IE.