Reputation: 3
I want to change the value of the 'data-list' attribute here :
<input id="Searchbar" data-list="Javascript,Css,Test" data-multiple/>
I tried :
Document.getElementById('Searchbar').XXXXX
All this stuff but I can't find the right way to do it.
Any suggestions?
Upvotes: 0
Views: 606
Reputation: 167182
The document
is case sensitive. Try:
document.getElementById('Searchbar').XXXXX
And to set the data-list
attribute, you need to do:
document.getElementById('Searchbar').setAttribute("data-list", "new,list");
Upvotes: 4