我试图在<p>标签中添加占位符,我尝试了以下方式,但dint工作.
我需要在<p>标记中使用占位符,它应该替换为输入文本中的值.
$( "#incharge" )
.keyup(function() {
var value = $( this ).val();
$( "p#incharge" ).text( value );
})
.keyup();Run Code Online (Sandbox Code Playgroud)
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" placeholder="The manager in charge name" data-toggle="tooltip" data-placement="right" id="incharge" name="incharge" title="Provide The manager in charge name">
<br>
<br>
<p id="incharge" placeholder="Some Placeholder text comes here"></p>Run Code Online (Sandbox Code Playgroud)