How can I show input value as different string on same page?
thats what i need;
CodePudding user response:
here is my example input div, i wanna "daktivite" value to string text
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroup-sizing-default" style="font-weight: 500;">Aktivite:</span>
</div>
<input type="text" class="form-control" name="daktivite" id="daktivite" aria-label="Default" aria-describedby="inputGroup-sizing-default">
</div>
CodePudding user response:
Try running the below code and check the output. I believe this is what you are trying to achieve.
<!DOCTYPE html>
<html>
<title>Web Page Design</title>
<body>
<div>Hello, World!
<span id="dup"></span>
</div>
<div>
<table>
<tr>
<th>header1</th>
<th>header1</th>
</tr>
<tr>
<td>123</td>
<td>data1</td>
</tr>
<tr>
<td>123</td>
<td><input id="val" onChange="data()"></td>
</tr>
</table>
</div>
<script>
data=()=>{
document.getElementById("dup").innerHTML= document.getElementById("val").value
}
</script>
</body>
</html>