Цитата:
|
Цитата:
|
Цитата:
<!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <!-- <link rel="stylesheet" type="text/css" href="tmp.css" /> --> <style type="text/css"> </style> <script type="text/javascript"> $(function (){ var txt='фигня всякая'; alert('>'+$('.child:contains("'+txt+'")').text()+'<') if ($('.child:contains("'+txt+'")').text()) { alert(1); }; if ('') { alert(1.1); }; txt='текст2'; if ($('.child:contains("'+txt+'")').text()) { alert(2); }; }); </script> </head> <body> <div class="main"> <div class="child">текст1</div> <div class="child">текст2</div> <div class="child">текст3</div> </div> </body> </html> |
ksa,
if ($('.child:contains("'+txt+'")').text()) это лишнее |
рони, видал как - даже еще короче. :)
|
if ('') { alert(1.1); }; wtf? |
cyber, ЧТД...
|
Цитата:
|
cyber, в том, что ты что-то не понял нет ничего страшного...
|
ksa, смысел от кода который некогда не выполниться ?
|
Часовой пояс GMT +3, время: 10:51. |