На одну кнопку два действия!
Надо на одну кнопку повесить два действия!
В плане я нажал все поля стали доступными после етого еще раз нажал и все поля стали опять readonly $('#start_change').click(function(){ $('.changeable').removeAttr('readonly'); $('#start_change').attr('id','end'); }); $('#end').click(function(){ alert('END'); }); Но почему не работает так. |
Цитата:
|
Evgeniy2019123, ты хоть бы пример тестовый полный сделал...
|
Evgeniy2019123,
строка 5 нельзя поставить клик на то чего нет!!! |
Evgeniy2019123,
<!DOCTYPE html> <html> <head> <title>Untitled</title> <meta charset="utf-8"> <style type="text/css"> </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(function() { var n = true; $('#start_change').click(function(){ $('.changeable').prop('readonly', n = !n); }); }); </script> </head> <body> <button id="start_change">click</button> <input type="text" class="changeable" readonly="readonly"> <input type="text" class="changeable" readonly="readonly"> <input type="text" class="changeable" readonly="readonly"> <input type="text" class="changeable" readonly="readonly"> <input type="text" class="changeable" readonly="readonly"> </body> </html> |
Цитата:
|
Цитата:
<!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> <title> Test </title> </head> <body> <button id='start_change'>Change</buuton> <input class='changeable' type='text' value='test'> <input class='changeable' type='text' value='test'> <input class='changeable' type='text' value='test'><input class='changeable' type='text' value='test'> </body> </html> |
Всем спасибо !
|
Часовой пояс GMT +3, время: 12:04. |