I am a jQuery newbie. I am trying to do something like this:
function putJStorageValues () {
var keys = getJStorageValues();
var test = "";
jQuery.each(keys, function(index, item) {
test += "<br>" + item;
});
$("#storageValues").text(test);
}
But this ends up with “
myItem”. How would I print HTML such that there is a line break and then the item?
$("#storageValues").text(test);<– this puts text on an element (strips HTML)$("#storageValues").html(test);<– this puts HTML in an element