javascript - Increased height of panel in div click -


I want to increase the height of the panel in the div click.

  & lt; Script language = "javascript" type = "text / javascript" & gt; Function highlights (this) {document.getElementById ('panel1'). Style.height = "200px"; } & Lt; / Script & gt; & Lt; div id = "flip" onclick = "tissue (this)" & gt; & Lt; Div & gt; & Lt; Div & gt; & Lt; ASP: panel id = "panel1" runat = "server" border style = "dotted" height = "50px" width = "125px" scrollbar = "horizontal" & gt; & Lt; / ASP: Cell & gt; & Lt; / Div & gt;  

This is a server-side control, so you will not get an element with ID = ' Panel 1 '.

If you see the source generated HTML of this page then you get the actual ID

document.getElementById function

You get the document. GetElementById ( '& lt;% = Panel1.ClientID% & gt;');

To enter the correct ID in your script

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -