同时编辑两个字段
我希望能够编辑一篇文章的标题,该标题在名为“url”的字段中重复,当用户在标题字段中输入时,该字段会实时更新......我该如何处理?
谢谢
I want to be able to edit the title of an article which is duplicated in a field called "url" which is updated in real time when the user types in the title field...how do I go about this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你可以使用 jQuery。查看手册。
You could use jQuery. Have a look at the Manual.
工作演示: http://jsfiddle.net/Wcp3D/
你的意思是这样的吗?
Working demo: http://jsfiddle.net/Wcp3D/
do you mean something like this?
我在工作中没有配置我的环境,但它应该是这样的:
I don't have my environment configured here at work, but it should be something like that:
将函数添加到字段一的更改事件,并更新该函数中的字段二:
Add a function to the change-event of field one, and update field two in that function: