Well, now you have gone through the SOURCE Element in the previous chapter. In this chapter we will learn about the SUMMARY Element, which is a child element of DETAILS Element.

<summary> . . . </summary>

The SUMMARY Element is used as a child element of DETAILS Element. The SUMMARY Element contains the default text, which is shown when the user see the browser and whenever user click this default text, the hidden text appears. The SUMMARY Element has minimized the external affords of JavaScript.

Here is the Syntax for SOURCE Element

Supported Browser
html5 tutorial html5 tutorial html5 tutorial html5 tutorial html5 tutorial


<summary> The default content will go here </summary>

Below is complete syntax along with example


<!DOCTYPE html>

<html>
	
    <head>
    	 <title>Title name will go here</title>
    </head>
    
    <body>
		
        <details>
	
			<summary>
    		This is the default content.
    		</summary>
            
            <p>This is the main content, which will be shown.</p>
    
		</details>
        
    </body>
    
</html>

Download