0

I have an HTML code with the following:

<object class="sis" id="sis1" type="text/html" data="sis/sis1.html"></object>

and in the imported file I have and <h2> I am trying to manipulate with JS, but I can figure out a way to select the element.

I've even tried: document.getElementById("sis1").getElementById("h2_id") but -> Uncaught TypeError: Object #<HTMLObjectElement> has no method 'getElementById'

2
  • Simply use document.getElementById("h2_id") Commented Nov 10, 2013 at 18:15
  • I have..but seems like JS does not see the ids inside the <object> when trying that. Uncaught TypeError: Cannot call method 'attr' of null Commented Nov 10, 2013 at 18:16

1 Answer 1

1

Have you tried with?

document.getElementById('sis1').contentDocument.getElementById('h2_id');
Sign up to request clarification or add additional context in comments.

1 Comment

I have now..but same result: Uncaught TypeError: Cannot call method 'attr' of null

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.