set up < input > and < P > tags when writing this form, hide the
tag and show < input > when you click to modify, but want to show the text of the p tag when editing the text box. I don"t know how to write this paragraph. Rookies turn to God for advice.
Let me simplify the code:
<form class="form" action="">
<div class="form-item">
<label>:</label>
<input style="display: none;">
<p class="user_text">
</div>
<div class="form-item">
<label class="layui-form-label">:</label>
<input type="radio" name="sex" value="nan" title="" checked disabled>
<input type="radio" name="sex" value="nv" title="" disabled>
</div>
<div class=form-item">
<label class="layui-form-label">:</label>
<input style="display: none;">
<p class="user_text">
</div>
<div class="form-item">
<label class="form-label"></label>
<input style="display: none;">
<p class="user_text">
</div>
<div class="form-item">
<label class="form-label"></label>
<input style="display: none;">
<p class="user_text">
</div>
<div class="form-item">
<button id="user_edit" onclick="editclick()"></button><!-- lay-submit -->
<button type="reset"></button>
</div>
</form>
the effect I want to express is something like this:
:
,
value
I can"t write jQuery code myself: so I"m a little dizzy
$(document).ready(function(){
//
var edit = $("-sharpuser_edit");
//
edit.click(editclick);
});
function editclick(){
var text = $(".user_text");
var input = $(".layui-input")
text.hide();
input.show();
}
The jQuery code above only hides and displays. The problem is that I can get a tag, but how to get several
together? I don"t know much about arrays.
I don"t know how to do it. Can you give me some advice?