I am passing a <ul><li></li><ul>
to jquery .html() method and it works.
I am assigning the html to a varaible and passing to .html() method .
As some security scans suggest me to use esc_html
on that variable.
But if i use it breaks the menu as it is not rendering html , just printing it as text.
So my question is -Do i have to sanitize HTML when i am passing it to Javascript , which is written by me ?? How ?