Home  >  Article  >  Web Front-end  >  In HTML5, set or return the attribute controls that the browser should display standard audio and video controls.

In HTML5, set or return the attribute controls that the browser should display standard audio and video controls.

黄舟
黄舟Original
2017-11-08 10:50:492148browse

Example

Launch Controls for Video:

myVid=document.getElementById("video1");
myVid.controls=true;

Definition and Usage

controls property is set or returned to the browser Standard audio and video controls should be displayed.

Standard audio and video controls include:

  • Play

  • Pause

  • Progress bar

  • Volume

  • Full screen switch (for video)

  • Subtitles (when available)

  • Tracks (when available)

## Browser support

All major browsers All controllers support the controls attribute.

Note: Internet Explorer 8 or earlier browsers do not support this attribute.

Syntax

Set controls attribute:

audio|video.controls=true|false

Return controls attribute:

audio|video.controls

Attribute value

ValueDescriptiontrueIndicates the display control. falseDefault. Indicates that the control is not displayed.
Technical Details

Return ValueBoolean value. true|falseDefault value: false
Example:

<!DOCTYPE html>  
<html>  
    <head>  
        <meta charset="utf-8">  
        <title></title>  
    </head>  
    <body>  
        <form action="" method="post">  
        <label id="label">  
            邮编:  
            <input type="text" name="text"value="" maxlength="6">  
            <small>请输入六位数字</small>  
        </label>  
            <input type="button" value="设置默认值" onclick="setValue()">  
        </form>  
        <script type="text/javascript">  
            function setValue(){  
                var label = document.getElementById(&#39;label&#39;);  
                var textbox = label.control;  
                textbox.value=&#39;10010&#39;;  
            }  
        </script>  
    </body>  
</html>

at In HTML5, you can place a form element inside a tag and access the form element through the tag's control attribute.

The above is the detailed content of In HTML5, set or return the attribute controls that the browser should display standard audio and video controls.. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn