: As per W3C can we add onclick inside li tag? I have 2 questions: As W3C can we add onclick inside <li> tag? Will this affect anything to do with SEO? For example: <li onclick="newDoc()">Click!</li>
I have 2 questions:
As W3C can we add onclick inside <li> tag?
Will this affect anything to do with SEO?
For example:
<li onclick="newDoc()">Click!</li>
function newDoc() {location.assign("http://validator.w3.org/");}
More posts by @Fox8124981
1 Comments
Sorted by latest first Latest Oldest Best
As far as I know, inline JavaScript is a no no. You seperate your HTML, PHP, CSS and JS files into different files. Inline styling/coding only makes bad maintainable code. You'll forget where you did what, and debugging will become a pain in the ass.
For SEO, if your pages are HTML(x/5) valid, no problems. As long as you don't expect them to run JavaScript (e.g.: show content only after click).
Yes, there are some situations where inline style/coding is OK, but they're exceptions.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.