Эй, ребята, у меня есть код следовать в ЯШ:JQuery оленья кожа событий работа над HTML формы в JavaScript
$(document).ready(function(){
$(".replyLink").click(function(){
$("#form-to-"+this.id).html(htmlForm()).toggle(500);
return false;
});
function htmlForm(){
var html;
html ='<form class="comment-form" id="form-post" action="request.php" method="post">';
html +='<input type="hidden" name="post_id" value="" />';
html +='<input type="hidden" name="reply" value="" />';
html +='<table><tr><td>Name:</td><td>';
html +='<input class="name" type="text" name="name" size="20" maxlength="30"/>';
html += ......
return html;
}
//this is not working!//////////////////////////////////////////
$(".comment-form input,.comment-form textarea").focus(function(){
$(this).css({
'background-color': 'white',
'border':'1px solid #3faefc',
'box-shadow': '0px 0px 2px 1px #95d3ff'
});
});
/////////////////////////////////////////////////////////////
});
HTML У меня есть ссылка на пример:
<a href='#' class="replyLink">Reply</a>
и когда я нажимаю эту форму переключать «где-то», но я не могу управлять элементом htmlForm() с кодом! Tnx
Wow thank you Its working :) respect –
Хмммм вы можете мне рассказать, как я могу установить как attr для htmlForm() идентификатор этого конкретного элемента form-to- [id]? –