我可以从 jwysiwyg 中获取原始 textarea id 吗?
我有一些文本区域:
<textarea id="temp1">Hello</textarea>
<textarea id="temp2">Hello</textarea>
...
我在它们上初始化 jwysiwyg:
$('#temp1').wysiwyg();
$('#temp2').wysiwyg();
我还有一个用于保存内容的自定义按钮。现在我怎样才能获得原始的textarea dom元素呢? (我需要区分这里出现的几次 jwysiwyg。)
function Wysiwyg() {
this.controls = {
save: {
exec: function () {
// Magically find the id of the original textarea plx.
...
谢谢...
I have some textareas:
<textarea id="temp1">Hello</textarea>
<textarea id="temp2">Hello</textarea>
...
and I initialize jwysiwyg on them:
$('#temp1').wysiwyg();
$('#temp2').wysiwyg();
I also have a custom button for saving the content. Now how can I get a hold of the original textarea dom element? (I need to distinguish between several occurances of jwysiwyg here.)
function Wysiwyg() {
this.controls = {
save: {
exec: function () {
// Magically find the id of the original textarea plx.
...
Thanks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您运行所见即所得的函数时,将选定的元素发送到该函数,并从传入的变量中调用该函数内的 jquery...
您必须记住,如果您有多个文本区域,则只能在文档上使用 id 一次。可以将其放在应用CSS中,如果您在单击的项目上使用$(this)引用,那么您不需要通过其他任何东西来调用它:
When you run the function for wysiwyg, send the selected element through to the function and call the jquery within that function from the passed in variable...
You must remember you can only use id once on the document if you have multiple text areas you can put this for applying css, if you use the $(this) reference on a clicked item then you do not need to call it by anything else: