草庐IT

ynternet

全部标签

jQuery - 如果点击 DIV 中的文本

我有一些DIV。在这些DIV中有一些文本、图像、标签……我需要在单击文本时显示“警报”。不是图像,不是其他标签,不是其他标签中的文本……只是DIV中的文本。如何用jQuery做到这一点?jsFiddleexample.HTMLSometext.Thisarelettersandthisarenot.Helloagain!Lettersinnewline.Newlettersinanotherline.CSSdiv{padding:10px0px0px20px;font-family:Verdana;height:40px;}em{color:red;} 最佳

jQuery - 如果点击 DIV 中的文本

我有一些DIV。在这些DIV中有一些文本、图像、标签……我需要在单击文本时显示“警报”。不是图像,不是其他标签,不是其他标签中的文本……只是DIV中的文本。如何用jQuery做到这一点?jsFiddleexample.HTMLSometext.Thisarelettersandthisarenot.Helloagain!Lettersinnewline.Newlettersinanotherline.CSSdiv{padding:10px0px0px20px;font-family:Verdana;height:40px;}em{color:red;} 最佳