javascript手冊-h[2]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 longj 的 blog

propertyname is one of the properties listed below.

property of

  • form

    描述

    a hidden object is a form element and must be defined within a <form> tag.

    a hidden object cannot be seen or modified by a user, but you can programatically change the value of the object by changing its value property. you can use hidden objects for client/server communication.

    properties

  • name reflects the name attribute
  • value reflects the current value of the hidden object

    methods

  • none.

    event handlers

  • none.

    例子

    the following example uses a hidden object to store the value of the last object the user clicked. the form contains a "display hidden value" button that the user can click to display the value of the hidden object in an alert dialog box. <htm> <head> <title>hidden object example</title> </head> <body> <b>click some of these objects, then click the "display value" button <br>to see the value of the last object clicked.</b> <form name="form1"> <input type="hidden" name="hiddenobject" value="none"> <p> <input type="button" value="click me" name="button1" onclick="document.form1.hiddenobject.value=this.value"> <p> <input type="radio" name="musicchoice" value="soul-and-r&b" onclick="document.form1.hiddenobject.value=this.value"> soul and r&b <input type="radio" name="musicchoice" value="jazz" onclick="document.form1.hiddenobject.value=this.value"> jazz <input type="radio" name="musicchoice" value="classical" onclick="document.form1.hiddenobject.value=this.value"> classical <p> <select name="music_type_single" onfocus="document.form1.hiddenobject.value=this.options[this.selectedindex].text"> <option selected> red <option> orange <option> yellow </select> <p><input type="button" value="display hidden value" name="button2" onclick="alert('last object clicked: ' + document.form1.hiddenobject.value)"> </form> </body> </htm>

    相关

  • cookie property

    history object

    contains information on the urls that the client has visited within a window. this information is stored in a history list, and is accessible through the navigator's go menu.

    语法

    to use a history object:

    1. history.propertyname
    2. history.methodname(parameters)
    
    propertyname is one of the properties listed below.

  • 本文关键:javascript
      相关方案
    Google
     

    本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

    go top