将div等任何元素变为输入框的属性contenteditable

只要是块级元素都可以用此属性变为输入框

<div contenteditable="true"></div>

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    
</head>
<body>
<div class="box_dis">
<!--<input class="search" type="text" id="tipinput" />-->
<div class="searc" type="text"  contenteditable="true" id="tipinput">
    <!--<img class='text'  src='../API/outstyle091100004.jpg' />-->
</div>
    </div>

</body>
</html>

 

你可能感兴趣的:(将div等任何元素变为输入框的属性contenteditable)