How to Jquery get the text of multiple tags of the same type and assign a value to the text box

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:

clipboard.png


:

,

value

clipboard.png

< hr >

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?

Mar.13,2021

for (var i = 0; I < input.length; iPP) {

input.eq(i).val(text.eq(i).html())

}
in the click event, you should be able to use

directly.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e47123-59c53.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e47123-59c53.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?