Div and Span labels display and hide divspan labels

Source: Internet
Author: User

Div and Span labels display and hide divspan labels

In this example, you can learn about jQuery to display and hide the div or span tag on a webpage.

In the actual environment, it may be based on certain conditions. when the conditions are met, the rows of a div or span label are displayed and hidden.

It is mainly used to learn jQuery functions and syntaxes, and place a button on the webpage, so that users can click a bit to hide or display it. A div tag and a span tag are also placed.

In the asp.net mvc environment, create an Action in the control:

 

Next, create a view (mark 1 ):

 

Mark 2: Add a button on the webpage. The value is "hide", indicating that the current status of the button is show.
Mark 3 to add a div and a span tag.
Mark 4 to reference the jQuery class library.
Mark 5 and write jQuery Code, especially the click Event of the button:

 

Real-time Demonstration:


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.