I use the following code for open webpage inside the HTML page. enter image description here

but its opening in another tab instead of that html page.

I need to open google webpage inside of the HTML body instead of another tab?

2

3 Answers

In your HTML you might have something like

<body> <iframe src=""></iframe> </body> 

Then in your function

var url = ' document.getElementById('myIframe').src = url; 
<!DOCTYPE html> <html> <body> <iframe src=""> <p>Your browser does not support iframes.</p> </iframe> </body> </html> 

Look at w3school for this simple information.

I am guessing you trying open new page using _self. Try to add "_self" as next parameter in open. Read more here

Try following code

var Url = ""; window.open(Url, "_self");