Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9223513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:05:51+00:00 2026-06-18T04:05:51+00:00

First some HTML code: <div id=content_4 class=content style=background:url(pic1.gif)></div> <div id=content_4_a class=content style=background:url(pic2.gif); display:none></div> This

  • 0

First some HTML code:

<div id="content_4" class="content" style="background:url(pic1.gif)"></div>
<div id="content_4_a" class="content" style="background:url(pic2.gif);
    display:none"></div>

This is the JS code:

function getOuterHMTL(element){
    return element.outerHTML;
}

function switchDisplayOuter(elementToHide, elementToShow, stringly){
    document.getElementsByName(elementToShow).outerHTML=stringly;
    document.getElementById(elementToHide).style.display="none";
    document.getElementsByName(elementToShow)[0].style.display="";
}

Now this HTML code works (when I click on it, the div switches and the picture changes):

<area shape="rect" coords="0,252,98,337" onMouseOver="switchDisplayOuter(
    'content_4', 'content_4_a', getOuterHMTL('content_4_a) )">

But not this one:

<area shape="rect" coords="0,252,98,337" onMouseOver="switchDisplayOuter(
    'content_4', 'content_4_a', '<div id="content_4_a" class="content" 
    style="background:url(pic2.gif); display:none"></div>' )">

It only gets me an error code while debugging in Firefox:

Error: SyntaxError: unterminated string literal
'<div id=

Somebody who knows the right code without using the function getOuterHMTL(element) but with “plain” string literal?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:05:52+00:00Added an answer on June 18, 2026 at 4:05 am

    You need to replace your " inside the onMouseOver attribute value with \':

    <area shape="rect" coords="0,252,98,337" onMouseOver="switchDisplayOuter('content_4', 'content_4_a', '<div id=\'content_4_a\' class=\'content\'  style=\'background:url(pic2.gif); display:none\'></div>' )">
    

    This is because your area tag’s onMouseOver attribute’s value is enclosed with ".

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all; example of HTML code: <div classgrap1> some conetent</div> <div classgrap2> some
I have the next code with some thumbnails: <div class=gallery-wrap> <div class=gallery galleryid-45 id=gallery-1>
I have the following code generating content on my site: <div class=content id=links> <?php
i have this html code: <div id=ht_key class=ht_all> <div class=ht_bottom> <div class=ht_bottom_p> <span class=ht_bottom_o>
I want to delete some data displayed in a HTML table row (first on
First some background, I've written an open source .NET library, named Duplicitiy (on github.com),
First some background: I'm working on an application and I'm trying to follow MVVM
Hi and thanks for your attention. First some background on the question: I have
I just declared some code-first models for a new project that uses EntityFramework. public
So I am executing a $.post() to get some html code returned from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.