介绍
这篇文章主要介绍了js实现页面点击小红心的示例,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获、下面让小编带着大家一起了解一下。
js的作用是什么
1,能够嵌入动态文本于HTML页面。2,对浏览器事件做出响应。3,读写HTML元素。4、在数据被提交到服务器之前验证数据。5,检测访客的浏览器信息。6,控制饼干,包括创建和修改等7,基于节点。js技术进行服务器端编程。
效果图
核心代码
爱。js
!function(e,t,a){function n(){c(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),o(),r()}function r(){for(var e=0;e引用方法
& lt; html  xmlns=癶ttp://www.w3.org/1999/xhtml"比; & lt; head> & lt; meta  http-equiv=癈ontent-Type",内容=皌ext/html;, charset=utf-8",/比; & lt; title>页面点击小红心& lt;/title> & lt;/head> & lt; body> 测试信息 & lt; https://www.yisu.com/zixun/script src=" love.js "> 脚本> 身体>