TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
noor unnisa
NA
19
2.2k
how to restore the list element style on clicking other elem
Nov 5 2015 5:08 AM
I am creating list elements dynamically and the list element color should change when we click on it,.
this functionality am getting through the following code:
function addLeaf(sText) {
var element = null;
try {
element = document.createElement("li");
element.innerText = sText;
element.style.cursor = "pointer";
element.onclick = function (event) {
element.style.color = "red";
};
but when i clicked another list element ,the first clicked list element should become normal ie,.in black color,.
if anyone can help
Reply
Answers (
1
)
how to add advertisements in website
HTTP Error 404.17 - Not Found