How can I change the css class of each th tag from “T” to “ST”? And how can I assign 1 more function(PI) to the button of the last table of iframe(A)
I have an iframe with the following HTML which is empty when I load a page.
<iframe id="A"></iframe>
I am loading the iframe(A) with the following code using JavaScript:
document.getElementById(A).src = 'https://adms.lifemark.ca/Apps/app_quickadd_frame.jsp?appid=102946&oppid='+Current;
After loading the iframe(A) it creates 10 iframe within iframe(A).Each new iframe has 1 table and many th tag. How can I change the css class of each th tag from “T” to “ST” ? And how can I assign one more function(PI) to the following button within the last table of iframe(A) using Jquery?
&开发者_StackOverflow社区lt;table>
<tbody>
<tr>
<td class="Submit">
<input type="Button" value="Submit" onclick="sb()" style="width:200px">
</td>
</tr>
</tbody>
</table>
use the .content() function to access the iframe.
Then do a .each() to loop between every iframes and then use .click() to assign the function to the button.
Can't be more precise considering the few infos you've provided.
try this:
$("#A").load(function () {
var frame = $(this).contents();
frame.find("iframe").contents().find("th.T").removeClass("T").addClass("ST");
frame.find("table:last td.submit input[type=button]").click(PI);
});
精彩评论