【发布时间】:2014-02-03 19:30:02
【问题描述】:
我想在用户点击时设置一个 HTML 输入框的值,使用 Kinetic.js。
这是输入框:
<input type="text" id="text_box">
这就是方法
stage.on('mousedown touchstart', function(evt) {
var shape = evt.targetNode;
if (shape) {
if (shape.getFill() == 'green') {
// this is where the text box value should be changed.
// I tried this:
$("#text_box").val("hello");
}
}
});
它似乎不起作用。
我该怎么做?
【问题讨论】:
-
尝试提醒。
标签: javascript jquery html kineticjs