首页
极刻
圈子
教程
开源
极客社区
写文章
发极刻
建圈子
发项目
登录 / 注册
返回教程:jQuery 教程
TRY RUN / 在线示例
jQuery 教程 尝试一下
jQuery 教程 尝试一下
源代码
运行
<!DOCTYPE html> <html> <head> <script src="//libs.baidu.com/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("p[title|='Tomorrow']").css("background-color","yellow");}); </script> </head> <body> <p title="Tomorrow">This is a paragraph.</p> <p title="tomorrow">This is a paragraph.</p> <p title="Tom">This is a paragraph.</p> <p title="See You Tomorrow">This is a paragraph.</p> <p title="Tomorrow-the day after today">This is a paragraph.</p> <p>This selector selects all elements with a title attribute value equal to 'Tomorrow', or starting with 'Tomorrow' followed by a hyphen.</p> </body> </html>
运行结果