I am a student studying JavaScript. I want to put the checkValue value in the strong tag into the input box, but I don't know how to write JavaScript to get it into the input box. Do I need to find cart_table of div? Or should I find a strong tag?
<script>
$().ready(function() {
$("#optionSelect").change(function() {
var checkValue = $("#optionSelect").val();
var checkText = $("#optionSelect option:selected").text();
var product = $("#productname").text();
var price = parseInt($("#price").text());
var test = parseInt($(this).find(':selected').data('price'));
var hapgae = price + test
if (checkValue != "no") {
var whtml =
" <div class=\"cart_table\">\n" +
" <hr style='width: 300px; margin-bottom: 30px;'>" +
" <p style='font-size: 17px;'>" + product + "</p>" +
" <p style='font-size: 13px; margin-top: -10px; class=\"check\" margin-bottom: 20px;'>" + checkText + "</p>" +
" <strong class=\"value_code2\">" + checkValue + "</strong>\n" +
" <input name=\"value_code\" id=\"value_code\" class=\"value_code\">" +
Strong tags and input tags refer to this part.
" <strong class=\"value_code2\">" + checkValue + "</strong>\n" +
" <input name=\"value_code\" id=\"value_code\" class=\"value_code\">" +