<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="Scripts/jquery-1.8.2.min.js"></script>
    <script type ="text/javascript">
        $(function () {
            $("input[type=button]:eq(0)").click(function () {
                $("<a href='#'>insertBefore</a>").insertBefore(this);
            });
            $("input[type=button]:eq(1)").click(function () {
                $("<a href='#'>insertAfter</a>").insertAfter(this);
            });
            $("input[type=button]:eq(2)").click(function () {
                $(this).after("<a href='#'>after</a>");
            });
            $("input[type=button]:eq(3)").click(function () {
                $(this).before("<a href='#'>before</a>");
            });
        });
    </script>
</head>
<body>
    <select >
        <option value ="1">中国</option>
        <option value ="2">美国</option>
        <option value ="3">德国</option>
    </select>
    <input type ="button" value="insertBefore"/>
      <input type ="button" value="insertAfter"/>
      <input type ="button" value="after"/>
      <input type ="button" value="before"/>
</body>
</html>

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-05-26
  • 2021-08-20
相关资源
相似解决方案