投稿 资料上传 提问 搜索
您现在的位置是: 首页 > 问答 > 正文

jQuery实现某个需求问题,请大神指点~

只能用jQuery实现,当鼠标移动到 I am a paragraph时,这段话从正常的变成了加粗的。并用jquery给 I am a paragraph 添加一个橘黄色的外边框应该怎么写 

 <!DOCTYPE html>

<html>
<head>
<title>jQuery Tutorial - Exercise</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> </script>




</head>
<body>
<h1> Tutorial 04 Basic jQuery Exercise </h1>

<div >
<h3>See what happens to me</h3>
</div>
<div class="second">
<p>I am a paragraph</p>
</div>

<div>
<button id="btn">Click me</button>
<p>Hello stranger</p>
</div>


<script>
//put your code here

$(document).ready(function(){
$("#btn").click(function(){

$("#fade").fadeToggle("slow");

});
});


</script>

</body>
</html>


问题回复
  1. 牛奶煮萝莉
    牛奶煮萝莉IT技术之家

    
    <div onmousemove="changeStyle()" onmouseout="normalStyle()">
        <p id="context">I am a paragraph</p>
    </div>
    
    function changeStyle(){
        $("#context").css({"font-weight":"700","border":"1px solid yellow"});
    }
    
    function normalStyle(){
        $("#context").css({"font-weight":"unset","border":"none"});
    }

    回复