+ 1
How to create onclick event in unorganised list,...
<ul><li><a herf="#">MY PAGE</a></ul>, I want to add ON CLICK EVENT BASED ON INNER HTML, USING JAVASCRIPT
10 Answers
+ 5
What is herf? Was it supposed to be href or smthing else?
+ 4
easiest is <li onclick="yourFunction()">
add the attribute `onclick`
+ 4
show ur code
+ 4
if u have a text? wrap it with span tag
<span onclick="()">my text</span>
like this?
+ 2
I think you didn't make closing tag for <li> đđ
+ 1
not working,
+ 1
I did that, let me try again
+ 1
thanx, it happens, but what if I have condition....like based on text "my page"....
+ 1
logic wrong, in if condition....
+ 1
OK, thanx...