JS 获取div id =jok中 title的值
求解

解决方案 »

  1.   

    document.getElementById("jok").getAttribute("title")
      

  2.   

    L@_@K
    <!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>
        <title> new document </title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="[email protected]" />
        <meta name="keywords" content="" />
        <meta name="description" content="" />
    </head>
    <body>
    <div id="jok" title="V" style="width:100px;height:20px;background-color: black;"></div>
    <script type="text/javascript">
    <!--
        var myJok = document.getElementById("jok");
        alert(myJok.title);
        myJok.title = "good job";
    //-->
    </script>
    </body>
    </html>
      

  3.   

    Web 开发常用手册DHTML 参考手册
    http://download.csdn.net/source/308913JScript 语言参考
    http://download.csdn.net/source/308916CCS 样式表中文手册
    http://download.csdn.net/source/304124
      

  4.   

    看3楼的
    document.getElementById("jok").title;
      

  5.   

    get
    1、document.getElementById("jok").getAttribute("title")
    2、document.getElementById("jok").titleset
    1、document.getElementById("jok").setAttribute("title", "jok div")
    2、document.getElementById("jok").title = "div jok";
    2种方法都可行