Javascript 在我的html代码中创建动态id
我从web上获取一个插件来创建动态选项卡。我试图根据自己的意愿修改代码,但我需要创建一个动态id。代码如下:Javascript 在我的html代码中创建动态id,javascript,jquery,html,dynamic,Javascript,Jquery,Html,Dynamic,我从web上获取一个插件来创建动态选项卡。我试图根据自己的意愿修改代码,但我需要创建一个动态id。代码如下: function addNewStaticTab() { $.addDynaTab({ tabID : 'addstatictab', type : 'html', html : "<table class='fontStreet' width='100%'> <tr> <td align='left'
function addNewStaticTab()
{
$.addDynaTab({
tabID : 'addstatictab',
type : 'html',
html : "<table class='fontStreet' width='100%'> <tr> <td align='left' class='td-label'>Intitulé*</td> <td width='2%'> </td> <td align='left' width='150'><input type='text' class='input-middle' required></td> <td> <figure onclick='makeCaptionAppear('figcaptionRosterInt');' style='position:relative; padding:0px; margin:0px;' ><img src='img/inter.png' id='buttonCriteresLeft'><figcaption class='figcaptionRoster2' id='figcaptionRosterInt' onMouseOut='makeCaptionDisappear('figcaptionRosterInt');'>Aide:<br> Exemples d'intitulés :<br>Projet, développement commercial, développement international, En création, prestataire, apporteur d'affaires, recherche d'emploi/opportunités, etc.</figcaption></figure> </td> </tr> </table>",
params : {},
tabTitle : 'NOUVELLE ACTIVITÉ'
});
}
函数addNewStaticTab()
{
$.addDynaTab({
tabID:'addstatictab',
键入:“html”,
html:“Intitulé*助手:
Intitulés示例:
项目、商业开发、国际开发、注册、任命、临时代办、雇员/机会等”,
参数:{},
标签标题:“新活动”
});
}
当id为“figcaptionRosterInt”时,我需要将其更改为动态id。如您所见,我调用一个函数打开另一个需要id的div弹出窗口,但即使其他选项卡中的窗口相同,id也需要唯一
我不知道你是否明白,对不起我的英语
提前感谢您的回答。如果我理解您的问题,您可以通过向
addNewStaticTab
函数
function addNewStaticTab(parameter_id)
{
$.addDynaTab({
tabID : 'addstatictab',
type : 'html',
html : "<table class='fontStreet' width='100%'> <tr> <td align='left' class='td-label'>Intitulé*</td> <td width='2%'> </td> <td align='left' width='150'><input type='text' class='input-middle' required></td> <td> <figure onclick='makeCaptionAppear('+ parameter_id +');' style='position:relative; padding:0px; margin:0px;' ><img src='img/inter.png' id='buttonCriteresLeft'><figcaption class='figcaptionRoster2' id='+ parameter_id +' onMouseOut='makeCaptionDisappear('+ parameter_id +');'>Aide:<br> Exemples d'intitulés :<br>Projet, développement commercial, développement international, En création, prestataire, apporteur d'affaires, recherche d'emploi/opportunités, etc.</figcaption></figure> </td> </tr> </table>",
params : {},
tabTitle : 'NOUVELLE ACTIVITÉ'
});
}
函数addNewStaticTab(参数\u id)
{
$.addDynaTab({
tabID:'addstatictab',
键入:“html”,
html:“Intitulé*助手:
Intitulés示例:
项目、商业开发、国际开发、注册、任命、临时代办、雇员/机会等”,
参数:{},
标签标题:“新活动”
});
}
您好,谢谢您的回复。我试过了,但不起作用。我的功能似乎有些问题。这里是://makehelp-caption-appear函数makeCaptionAppear(id){get(id).style.display=“block”}看起来问题出在“连接”中。对不起,我太糟糕了:(试试这个:makeCaptionAppear(“+parameter\u id+”)