web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Get Element in a webresource in Portal

(0) ShareShare
ReportReport
Posted on by 225

Hi, 

Is there a way to get an Element of an html-webresource. I have a function on an entityform in portals, which needs an element in a webresource. This webresource is on the form. 

I can get the webresource with " document.getElementById("WebResource1") ". How can I get container1? 

The webresource looks like this in the browser:

<iframe id="WebResource1" src="/_webresource/cr435_HTML1" >

#document

<html>

<head>

</head><body onfocusout="parent.setEmailRange();" style="overflow-wrap: break-word;" >
<div id="container1"> </div>

</body></html>

</iframe>

I have the same question (0)
  • Verified answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    Please use "document.getElementById("WebResource1").contentWindow.document.getElementById("container1")".

    I inserted a same html into form and get this div in portal entity form.

    pastedimage1584690565311v2.png

    pastedimage1584690466005v1.png

    Best Regards,

    Leo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
NeerajPawar Profile Picture

NeerajPawar 31

#2
Robert Bailey Upzoids Profile Picture

Robert Bailey Upzoids 20

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 19 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans