Solution 1 :

You are trying to insert a HTML <button> inside the <input>, you cant do that you cant insert HTML elements inside an <input>

You can insert it after it with .after() or before it with .before()

check this code:

var boxes = $(".row");
var saveBtn = $("<button>").text("complete");
// boxes.before(saveBtn)
boxes.after(saveBtn)
console.log(saveBtn);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="container">
    <div class="boxes">
        <input class="row 1" type="text">
        <input class="row 2" type="text">
        <input class="row 3" type="text">
        <input class="row 4" type="text">
        <input class="row 5" type="text">
        <input class="row 6" type="text">
        <input class="row 7" type="text">
        <input class="row 8" type="text">
    </div>
</div>

Solution 2 :

Change this line

var saveBtn = $("<button>").text("complete");

into

var saveBtn = "<button>complete</button>";

Problem :

This is my code

HTML

<div class="container">
    <div class="boxes">
        <input class="row 1" type="text">
        <input class="row 2" type="text">
        <input class="row 3" type="text">
        <input class="row 4" type="text">
        <input class="row 5" type="text">
        <input class="row 6" type="text">
        <input class="row 7" type="text">
        <input class="row 8" type="text">
    </div>
</div>

JAVASCRIPT

var boxes = $(".row");
var saveBtn = $("<button>").text("complete");
boxes.append(saveBtn)
console.log(saveBtn);

why my button is not showing on my web page?

Comments

Comment posted by melvin

When does your jQuery code executed ? on clicking something ?

Comment posted by Nakwon Yoon

no it was the error I said this was really helped me sorry

Comment posted by Nakwon Yoon

And I have no idea that reputation is -1.. I actually did thums up

Comment posted by Marik Ishtar

Its okey bro, glad to help.

Comment posted by Nakwon Yoon

I have some questions about how to save the input values to save to local storage. is it possible?? and how lol I have no idea I used ‘saveBtn.on(“click”, function(e){ event.preventDefault();’

Comment posted by Marik Ishtar

yes you can its very easy by just using localStorage.setItem(name, value);

Comment posted by melvin

That’s not an issue.

By