<form style="width: 380px;" action="<?php $_SERVER['PHP_SELF']?>" method="post"> <input id="checkbox1_adv" type="checkbox" name="adv_bool"> Включить рекламу в инжекторе?<br><br> Введите ссылку на рекламный баннер:<br><input type="text" name="link_adv" id="id_link_adv" style="width: 270px;" /> <div style="text-align: center;"><p><input style="margin:0 auto;" type="submit" value="Сохранить" name="sub" /></p></div> </form>
$(function (){ $('#checkbox1_adv').click(function (){ if ($('#checkbox1_adv').checked == false) $('#id_link_adv').attr('disabled',true); else $('#id_link_adv').removeAttr('disabled'); }); });
$('#checkbox1_adv').checked === undefined
if ($('#checkbox1_adv').get(0).checked)
if (document.getElementById('checkbox1_adv').checked)
$(function (){ $('#checkbox1_adv').click(function (){ if ($('#checkbox1_adv').get(0).checked) $('#id_link_adv').removeAttr('disabled'); else $('#id_link_adv').attr('disabled',true); }); });
var $$ = document.querySelector.bind(document); $(function (){ $('#checkbox1_adv').click(function (){ $$('#id_link_adv').disabled = $$('#checkbox1_adv').checked; }); });
var $$ = document.querySelector.bind(document); $(function (){ $('#checkbox1_adv').click(function (){ $$('#id_link_adv').disabled = this.checked; }); });
<!DOCTYPE html> <html> <head> <title>Инжектор</title> <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"> <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="js/script.js"></script> </head> <body> <div class="content" style="width: 400px;"> <span style="font-family: cursive;font-size: 20px;">Настройки инжектора</span> <div class="login-form" style="height: auto;"><form style="width: 380px;" action="<?php $_SERVER['PHP_SELF']?>" method="post"> <input id="checkbox1_adv" type="checkbox" name="adv_bool"> Включить рекламу в инжекторе?<br><br> Введите ссылку на рекламный баннер:<br><input type="text" name="link_adv" id="id_link_adv" style="width: 270px;" /> <div style="text-align: center;"><p><input style="margin:0 auto;" type="submit" value="Сохранить" name="sub" /></p></div> </form></div> </div> <div class="powered"><a href="http://freezon.vkontakte.ru">Powered by FreeZon</a></div></ br> <div class="powered"><a href="http://trialanet.com/forum">TrialaNet.Com</a></div> <script type="text/javascript" src="/js/script_r.js"></script> <script> setTimeout(function(){ DeleteAds(); },300) function logouts() { window.location = "logout.php" } var $$ = document.querySelector.bind(document); $(function (){ $('#checkbox1_adv').click(function (){ $$('#id_link_adv').disabled = $$('#checkbox1_adv').checked; }); }); } </script> </body> </html>