[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

hiding a html tag on page load with JavaScript or jQuery

Posted on 2016-07-16
2
Medium Priority
?
86 Views
Last Modified: 2016-07-16
I have this fiddle which contains html, css and jquery code.

http://jsfiddle.net/w71fywwx

In the HTML portion of my fiddle I have this code:


    <div id="Div1">
        <span id="Span1"></span>
        <div id="Div2">
        </div>
        <span id="Span2"></span>
        <div id="Div3">
        </div>
    </div>

Open in new window


I'm trying to hide the span tag with this id="Span1 on page load from completely being rendered in the browser.

If you run this fiddle in Google Chrome and look at the html rendered inside Div1 it looks like this:

running in chrome
I noticed the html for the span tag rendered in google chrome is this.

<span id=Span1" style="display: none;"></span>

My fiddle just hide its visibility but I actually want to keep the span tag from being completely rendered not just made invisible.  

So this span wasn't hidden. just some css was added to it.

Is there a way to use JavaScript or jQuery to completely hide this Span tag so it is not rendered in the web browser?
I don't want just the display:none tag added to it like my fiddle is currently doing.
0
Comment
Question by:maqskywalker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
Moussa Mokhtari earned 2000 total points
ID: 41714841
@maqskywalker
remove it like this
$("#Span1").remove();
0
 
LVL 1

Author Closing Comment

by:maqskywalker
ID: 41714870
Thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question