<div class="profile"> <h2>hello<br> <span>Welcome to my CV website</span> </h2> </div>加一段jQuary
时间: 2023-07-09 19:24:46 浏览: 57
Sure, here's an example of how to add a jQuery script to modify the HTML:
```
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$('.profile span').css('color', 'blue');
});
</script>
```
This script will change the color of the span element inside the div with class "profile" to blue. You can modify it to perform other actions on the HTML page.
相关问题
<div class="profile"> <h2>hello<br> <span>Welcome to my CV website</span> </h2> </div>加入jquary
可以使用以下代码将 jQuery 添加到您的 HTML 文件中:
```
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
```
然后,您可以使用以下代码将 HTML 元素添加到您的 HTML 文件中:
```
<script>
$(document).ready(function() {
$('.profile').append('<p>This is my CV website.</p>');
});
</script>
```
这将在页面加载完毕后,向 `class` 为 `profile` 的 HTML 元素中添加一个段落。您可以根据需要更改内容和选择器。
<div class="profile"> <h2>hello<br> <span>Welcome to my CV website</span> </h2> </div>加一段jQuary
Sure! Here's an example of adding a jQuery script to animate the "hello" text on hover:
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('.profile h2').hover(function() {
$(this).find('span').addClass('animated');
}, function() {
$(this).find('span').removeClass('animated');
});
});
</script>
```
Make sure to include the jQuery library in your HTML file before adding this script. Also, you can replace the "animated" class with any CSS class you want to apply the animation.