在html中取得 javascript 里面的值

供稿:hz-xin.com     日期:2024-05-02
html中怎么获取js方法中返回的值

  在应用DIV布局时,有时会希望DIV的高度会随着内容的变化而变化;
  可以通过如下属性的设置达到效果: 
       设置div最小高度及高度自动伸展的实例    .divHeight{height:400px;height:auto;min-height:500px;width:800px; background:#bbeeeb;margin:0 auto;}          此div具有最小高度且高度可以随着内容的增高而自动伸展      

年龄:function check(){var age=document.geElementById("age").valueif(0=18){alert("成年")}else{alert("输入有误")}}

<select name="pagesize" onchange="selectPagesize(this.value)" id="sel" >
</select>
<a href="javascript:;" onclick="selectPagesize(document.getElementById('sel').value);">sel</a>
就这样。。。

给接收a值的html标签一个id,比如receiveId,selectPagesize方法里,document.getElementById("receiveId").value = a;