on-internet
← Community

change background color of div on button click

Stack Overflow ·

In my code behind i am generating html string <a href='#' class='my-post' onclick='myFunc(" + Id + ")'> <div class='my-idea'> <span >23</span> <span class='heart'></span> </div> </a> I have implemented myFunc function in code behind as below funcString += "function myFunc(id){"; funcString += "document.getElementById(\"" + btn1.ClientID + "\").click();"; funcString += "}"; Then on btn1 click event i do some processing protected void btnSubmitWinnerPage_Click(object sender, EventArgs e) { // some processing } Now i want to change background color of div inside that href tag when button is click

Comments

Sign in or sign up to comment and upvote.

No comments yet.