.append:清除输入值onclick
我有一个书签,它附加在正文上以调出一个小 litebox。那个 Litebox 中有一个表格。当用户单击输入字段时,我希望当前值消失。这是我到目前为止所尝试过的,但它不起作用。
function runthis() {
$('body').append("<p><input type='text' name='story_price' value='Price' onClick='this.value=''' /><p>");}
我也尝试过这个,但它不允许我的书签显示:
function runthis() {
$('body').append("<p><input type='text' name='story_price' value='Price' onClick='this.value=""' /><p>");}
有关如何清除 .append 中的内容的任何想法
谢谢!
I have a bookmarklet that appends the body to bring up a little litebox. In that litebox there is a form. When the user clicks on an input field I want the current value to disappear. This is what I have tried so far and it isn't working.
function runthis() {
$('body').append("<p><input type='text' name='story_price' value='Price' onClick='this.value=''' /><p>");}
I have also tried this and it doesn't allow my bookmarklet to show up:
function runthis() {
$('body').append("<p><input type='text' name='story_price' value='Price' onClick='this.value=""' /><p>");}
Any thoughts on how I could possible clear the contents within the .append
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
转义引号
("可以在双引号内使用单引号")
('这不行') - 应该是 ('这不行')
Escape your quotes
("It is 'OK' to use single quotes inside double")
('This isn't OK') - should be ('This isn\'t OK')