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

  • SEARCH
  • Home
  • 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 8237605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:31:26+00:00 2026-06-07T19:31:26+00:00

<span id=’a’><img src=’b.gif’ /></span> <script> alert(document.getElementById(‘a’).innerHTML); </script> The output is: <img src=b.gif /> ‘b.gif’

  • 0
<span id='a'><img src='b.gif' /></span>
<script>
alert(document.getElementById('a').innerHTML);
</script>

The output is: <img src="b.gif" />

‘b.gif’ is being shown as “b.gif”

Viewing the source code in FireBug also shows double quotes. Why is this happening?

  • 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-07T19:31:28+00:00Added an answer on June 7, 2026 at 7:31 pm

    Double quotes are the standard for attributes, single quote are obviously acceptable though.

    The innerHTML is the processed set of tags, so the browsers will set the attributes with double quotes as standard

    As has been pointed out, there is no “standard” when it comes to double or single quotes on attributes.

    My guess would be that browsers use double quotes by default, and therefore when you request the innerHTML, it will format them as such. If I am incorrect, I will remove this answer immediately

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

Sidebar

Related Questions

My script extract span with it's attributes. I want to replace span with attributes
I have a Span tag containing a IMG tag and another Span tag. I
I have problem with calculating span height in IE7 document mode. To be precise,
The span tag that encompasses the text I'm trying to display is of 500px
I would like a span to update when a value is entered into a
If I have a span , say: <span id="myspan"> hereismytext </span> How do I
I have WPF Span that is used as a source to a TextBlock. I
I have two span elements that I would like to stay on the same
I have a span with the following style: margin: 5px 0; padding: 2px; cursor:
When a span is nested in a div with a different background there's 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.