Smart forms-fill in URL addresses with DataList elements

Source: Internet
Author: User

DataList List of options

A new form feature that has been long awaited is that users can now create their own entries from a drop-down menu. As we all know, the Select element is limited to the specified option value the Web Developer's past practice is to add an expandable list of options to the text field through various JavaScript techniques.

Now H5 is a good solution to this problem. The new element DataList and the option element are essentially similar, all of which implement the functionality of the container. But now we can assign any INPUT element to the DataList element to display the desired options.

The code is as follows:

<!DOCTYPE HTML><HTML>    <Head>        <MetaCharSet= "Utf-8" />        <title></title>    </Head>    <Body>        <form>            <P>                <label for= "url"Center; ">Goto</label>/ http<inputtype= "text"ID= "url"name= "Homepage"List= "homepages Autofocus"/>                <DataListID= "Homepages">                    <optionvalue= "Www.geogle.com"></option>                    <optionvalue= "Html5.komplett.cc/welcom"></option>                    <optionvalue= "slashdot.org"></option>                    <optionvalue= "Wired.com"></option>                                    </DataList>                <inputtype= "Submit"onclick= "window.location= ' http://' +document.getelementbyid (' url '). Value;return false; "name=""ID=""value= "Take Off"Align= "Center"/>            </P>        </form>    </Body></HTML>

Why does the pull-down effect come out?

Smart forms-fill in URL addresses with DataList elements

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.