Avatar of areyouready344
areyouready344
Flag for United States of America

asked on 

how to create a ul and li and then test the variable?

how to create a ul and li and then test the variable? Not working...

var variable = 0;

$("<ul id='set'><li> + variable + </li></ul>");

alert("check li variable value: " + $("#set li").val()); or alert("check li variable value: " + $("#set li").text());

Not working, returning undefined when using val()
and empty when using .text()
JavaScript

Avatar of undefined
Last Comment
areyouready344

8/22/2022 - Mon