js生成的输入按钮不起作用 [英] js generated input button not working

查看:70
本文介绍了js生成的输入按钮不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗯,这个论坛真的没有给你足够长的时间来输入你的问题,然后再把你赶出去......这就是我的第二次尝试:


我正在尝试用dom脚本教我自己的javascript,并且我正在尝试编写应用程序。它一直很好,但我遇到了一个让我发疯的问题。


我将从解释我想要达到的目标开始...我只是试图将一个输入按钮插入一个特定位置的表中,该位置在单击时调用一个函数。例如,我试图将它放入表格的第3行第4列。


所以我开始创建一个调用javascript来插入该按钮的按钮。这很好用。在脚本中我首先定义新元素,如下所示:

Hmm this forum really doesn''t give you long enough to type in your question before logging you out.. well here goes my second attempt:

I''m trying to teach myself javascript with dom scripting and am attempting to write an application as I learn. It''s been going fine but I''ve ran into a problem which is driving me crazy.

I''ll start off by explaining what I''m trying to achieve... I''m simply trying to insert an input button into a table at a specific place which calls a function when clicked. For examples sake I''m trying to place it into row 3, column 4 of the table.

So I started off by creating an button that called the javascript to insert that button. This works fine. In the script I first define the new element like so :

展开 | 选择 | Wrap | 行号

推荐答案

hi ...


尝试不使用setAttribute方法...使用类似的东西:

hi ...

try to not use the setAttribute-method for it ... use something like that:

展开 | 选择 | Wrap | 行号


你非常接近。

You were pretty close.

展开 | 选择 | Wrap | 行号



嗯这个论坛真的没有给你足够长的时间来输入你的问题,然后再将你退出..在这里我的第二次尝试:


我正在尝试用dom教自己的javascript脚本编写,我正在尝试编写应用程序,因为我学习。它一直很好,但我遇到了一个让我发疯的问题。


我将从解释我想要达到的目标开始...我只是试图将一个输入按钮插入一个特定位置的表中,该位置在单击时调用一个函数。例如,我试图将它放入表格的第3行第4列。


所以我开始创建一个调用javascript来插入该按钮的按钮。这很好用。在脚本中我首先定义新元素,如下所示:

Hmm this forum really doesn''t give you long enough to type in your question before logging you out.. well here goes my second attempt:

I''m trying to teach myself javascript with dom scripting and am attempting to write an application as I learn. It''s been going fine but I''ve ran into a problem which is driving me crazy.

I''ll start off by explaining what I''m trying to achieve... I''m simply trying to insert an input button into a table at a specific place which calls a function when clicked. For examples sake I''m trying to place it into row 3, column 4 of the table.

So I started off by creating an button that called the javascript to insert that button. This works fine. In the script I first define the new element like so :

展开 | 选择 | Wrap | 行号


这篇关于js生成的输入按钮不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆