0

我有用于使简单字段可编辑的简单 JS 代码:

<html>
<head>
    <script type="text/javascript" src="jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="jquery.jeditable.js"></script>
</head>
<body>
    <table border='1'>
    <div id="load-button" style="border:1px solid black; background-color:white;padding:5px;cursor:pointer;width:200px;text-align:center;border-radius:4px;">Load button</div>
    <b class="mouseover1" style="display: inline">mouseover me1</b>
    <b class="mouseover2" style="display: inline">mouseover me2</b>
    <script type="text/javascript" charset="utf-8">
        $(function() {
          $(".mouseover1").editable("echo.php", { 
              event     : "mouseover",
              style  : "inherit"
          });  
        });
    </script>
</body>
</html>

我对JS的了解很少,我需要知道如何设置mouseover1字段和mouseover2的功能。谢谢你。

4

1 回答 1

1

使用选择器:

$(".mouseover1,.mouseover2")

或者更好地使它们都属于同一类

于 2012-06-25T05:41:28.927 回答