/    Sign up×
Community /Pin to ProfileBookmark

How can I change the css class of each th tag from “T” to “ST”? And —

I have an iframe with the following HTML which is empty when I load a page.

[code=html]<iframe id=”A”></iframe> [/code]

I am loading the iframe(A) with the following code using JavaScript:

[CODE]
document.getElementById(A).src = ‘https://adms.lifemark.ca/Apps/app_quickadd_frame.jsp?appid=102946&oppid=’+Current;[/CODE]

After loading the iframe(A) it creates 10 iframe within iframe(A).Each new iframe has 1 table and many th tag.

I have the following question:
1) How can I change the css class of each th tag from “T” to “ST” using Jquery?
2) How can I assign one more function(PI) to the following button within the last table of iframe(A) using Jquery? This function should execute after first fuction(S?.

[code=html]
<table>
<tbody>
<tr>
<td class=”Submit”>
<input type=”Button” value=”Submit” onclick=”sb()” style=”width:200px”>
</td>
</tr>
</tbody>
</table>[/code]

3) How can I enable a checkbox(id=”111″) in all the frames except first frame and assign function(CopyPrevious) to the checkbox using Jquery?

Thanks

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@KorSep 07.2011 — By short, you can't, because, in your example, the document loaded in the iframe belongs to another domain. It is not possible to modify, via JavaScript, a document cross-domains, for obvious security reasons.
Copy linkTweet thisAlerts:
@asifakhtarauthorSep 07.2011 — Kor, the document loaded in the iframe belongs to the same domain.
Copy linkTweet thisAlerts:
@KorSep 07.2011 — <i>
</i>document.getElementById(A).src = [COLOR="Red"]'https://[/COLOR]adms.lifemark.ca/Apps/app_quickadd_frame.jsp?appid=102946&amp;oppid='+Current;

It does not look like the same domain to me. Otherwise you should have set the iframe's src as a relative address, not as an absolute one.
×

Success!

Help @asifakhtar spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...