Dynamically Add or remove control in asp.net core using JavaScript

If you want to add some controls on your web browser, i mean to say if you want to add controls on run time then you can easily dome with any script control, without using c# code. So, here i used Java Script code to add controls on a page. And your code is


<form method="post">
    <div id="firstdiv">
        <input type="text" name="testinput" />
                <input type="button" value="add dynamic" onclick="DynamicText()"/>

            <input type="submit" value="submit"/>


function DynamicText() {
    var division = document.createElement('DIV');
    division.innerHTML = DynamictextBox("");
function DynamictextBox(value) {
    return '<div><input type="text" name="dyntxt" /><input type="button" onclick="ReTextBox(this)" value="Remove"/></div>';
function ReTextBox(div) {

If you want to use this code , learn :

Jacob Lefore

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google