app-root > app-home > main" /> app-root > app-home > main" /> app-root > app-home > main"/>

Use javascript variable in document.querySelector (howTo)

21 views Asked by At

how can I replace the "16" by the javascript-variable "sixteen"?

var sixteen=16;
var span600=document.querySelector("body > app-root > app-home > main > app-chat > div > app-chat-list > div > ul > li:nth-child(16) > app-comment > div > div > div > button > span");

-Does it work if I use the javascript variable sixteen directly in the document.querySelector or do I have to convert the variable to a string using: sixteen.toString()

0

There are 0 answers