选择所有跨度并基于id使用该值 [英] selecting all span and based on id use the value
问题描述
Hii,
< script type =text / javascript>
$(document).ready(function( ){
调试器;
$('#Draft')。live('click',function(){
alert(I我在这里起草);
});
$('#Live')。live('click',function() {
提醒(我住在这里);
});
$('#完成')。直播('点击',功能(){
提醒(我在这里完成);
});
});
< / script>
Curretly我正在检查每个的所有id和绑定点击功能..
有什么方法我可以获取所有的span元素..说哪个样式属性就像
Hii ,
<script type="text/javascript">
$(document).ready(function () {
debugger;
$('#Draft').live('click', function () {
alert("I am Draft Here");
});
$('#Live').live('click', function () {
alert("I am live Here");
});
$('#Completed').live('click', function () {
alert("I am completed Here");
});
});
</script>
Curretly i am checking all id and binding click function for each ..
is there any way in which i can fetch all span elements .. say whose style attribute is like
style =color:
style="color:
<span style="color:#F3660E;" id="Draft">Draft: (2138)</span>
并且基于此我可以获得与此相关的所有跨度元素然后我可以检查每个id点击
and based on that i can get all span elemnts related to that and then i can check each id and execute my respective code on click
推荐答案
(文件).ready(function(){
调试器;
(document).ready(function () {
debugger;
('#Draft')。live('click',function(){
alert(我在这里草稿);
});
('#Draft').live('click', function () {
alert("I am Draft Here");
});
('#Live')。live('click',function(){
提醒(我住在这里);
});
('#Live').live('click', function () {
alert("I am live Here");
});
这篇关于选择所有跨度并基于id使用该值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!