易截截图软件、单文件、免安装、纯绿色、仅160KB

javascript 控制 DIV等html元素的显示和隐藏

1
、编写
js
函数
<script
type="text/javascript">
    function display(id){
        var
traget=document.getElementById(id);
        
if(traget.style.display=="none"){
                
traget.style.display="";
         }else{
                
traget.style.display="none";
       }
   
}
</script>
2.、
要显示
/
隐藏的
html
元素加上
id
属性
<table>
     <tr id="menu"
>   
        <td>
控制这个
tr
的显示
/
隐藏
</td>
    </tr>
</table>
3
、添加按钮,链接等触发
js
函数
<input type="button"
onclick="display(
'menu'
)"
  
value="
显示
/
隐藏
"/>
<a href="#"  
onclick="display(
'menu'
)"
  
>
显示
/
隐藏
</a>
javascript
显示隐藏层
<div id=""
style="display:none;">
广告
</div>
<input type="botton"
onclick="
函数
">
<script
language=javascript>
function
函数
{
if(thisdiv.style.display=='none'){
thisdiv.style.display=""
}
else
thisdiv.style.display="none"
}
</script>
你先给
div
取个
ID=“AA”thisdiv=AA
javascript
隐藏
/
显示表单对象

<SCRIPT
language=javascript>
function expandIt(el) {
      whichEl
=document.getElementById(el)
      if (whichEl.style.display ==    'none')
{
 &nbs


相关文档:

字符串中的JSON转换成JAVASCRIPT的OBJECT

// 下面代码块实现了string.parseJSON方法
(function(s){
  // This prototype has been released into the Public Domain, 2007-03-20
  // Original Authorship: Douglas Crockford
  // Originating Website: http://www.JSON.org
  // Originating URL    : http://www.JSON.o ......

JavaScript中this关键字使用方法详解

在面向对象编程语言中,对于this关键字我们是非常熟悉的。比如C++、C#和Java等都提供了这个关键字,虽然在开始学习的时候觉得比较难,但只要理解了,用起来是非常方便和意义确定的。JavaScript也提供了这个this关键字,不过用起来就比经典OO语言中要"混乱"的多了。
下面就来看看,在JavaScript中各种this的使用方法有什么 ......

javascript弹出一个指定大小的窗口


Java代码
<script language="JavaScript">   
function js_show(per_id)   
{   
   window.open('/weihu/person/viewResume.jsp?perID='+per_id, 'resume', 'resizable=yes,menuBar=0,toolBar=0,scrollbars=yes,width=800,height=600,left ......

javascript基础

每一项都是js中的小技巧,但十分的实用!
1.document.write(""); 输出语句
2.JS中的注释为//
3.传统的HTML文档顺序是:document->html->(head,body)
4.一个浏览器窗口中的DOM顺序是:window->(navigator,screen,history,location,document)
5.得到表单中元素的名称和值:document.getElementById("表单中元素的 ......

JavaScript xmlTree

<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title> JavaScript: xm ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号