<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("#usr").click(function () {
var divElement = "<div style='color:yellow;'>more text</div>";
$('#usr').val($('#usr').val() + divElement);
});
});
</script>
</head>
<body>
<input class="form-control" id="usr">
</body>
</html>
I want to add this div element inside the text box but it get as the string and display.
Is it possible to do this or is there any other way to do this like input. Thank you