It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center。
7年前关闭。
我的div里面有图像,也有文本框。我想做的是在文本框中键入某些内容,而在我键入相同内容时,应在图像中显示用户定义的字体。是否可以使用js / jquery?谢谢。
jQuery的:
7年前关闭。
我的div里面有图像,也有文本框。我想做的是在文本框中键入某些内容,而在我键入相同内容时,应在图像中显示用户定义的字体。是否可以使用js / jquery?谢谢。
最佳答案
是的,有可能。我为您创建了一个演示。
See Demo
HTML:
Title: <input type="text" id="txtbox_title" />
<br/>
<br/>
Text: <textarea id="txtbox_para" ></textarea>
<div id="imageContainer">
<h1></h1>
<p></p>
</div>
jQuery的:
$("#txtbox_title").on('keyup', function(){
var value = $(this).val();
$("#imageContainer h1").html(value);
});
$("#txtbox_para").on('keyup', function(){
var value = $(this).val();
$("#imageContainer p").html(value);
});
关于javascript - 在图像上放置文字输入,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12472039/