125
rated 0 times
[
132]
[
7]
/ answers: 1 / hits: 7599
/ 5 Years ago, tue, february 12, 2019, 12:00:00
In my HTML file I have a div with id=list.
Now I want to display a string from my javascript in my html. page. but nothning
happen. In my html file, i've imported the srcipt file. Here's how it looks in my script file:
var namesArray = [lars, bo, ib, peter, jan, frederik];
var list = namesArray.map(name=><li>+name+</li>);
var listAsStr =<ul> + list.join() + <ul>;
document.getElementById(list).innerHTML = listAsStr;
More From » html