Sample Code for creating a canvas element in HTML5

Source: Internet
Author: User

Comments: This article describes how to declare HTML5 and how to use HTML5 to create canvas elements. If you need it, refer to HTML5 to create canvas elements.

The Code is as follows:
<! -- <! DOCTYPE> Declaration must be the first line of the HTML document, located before the <! DOCTYPE html>
<Html>
<Head>
<Meta http-equiv = "Content-type" content = "text/html; charset = UTF-8">
<Title> HTML5 </title>
<Script type = "text/javascript" charset = "UTF-8">
<! -- This function will be called after the page is fully loaded -->
Function pageLoaded ()
{
Alert ('html5 page loaded! ');
}
</Script>
</Head>
<Body onload = "pageLoaded ();">
<Canvas width = "640" height = "480" id = "tCanvas" style = "border: black 1px solid;">
<! -- The following font is displayed if the browser does not support it -->
Tip: your browser does not support <canvas> labels
</Canvas>
</Body>
</Html>

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.