#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2009
    Location
    Atlanta, GA, USA (unfortunately)
    Posts
    59
    Rep Power
    6

    Exclamation Append 'Click to Exit' to H4 Element


    Hello all,

    For some reason, this line of code will not execute:

    Code:
     $("#successfulsubmit h4").append('Click to Exit');
    It is within this block now, but I have tried it in other places...
    Code:
    			setTimeout(function(){
    			  $("#successfulsubmit h4").append('Click to Exit');	
    		          $("#blackoverlay, #successfulsubmit").click(function(e){
    			     $("#blackoverlay, #successfulsubmit").remove();
    		           });
    This is the associated HTML:
    Code:
        <div id="successfulsubmit">
        	<h3>&nbsp;</h3>
        	<p>&nbsp;</p>
            <h4>&nbsp;</h4>
        </div>
    It's on this page (emailbox.js).

    Is it simple to know why that append statement won't work when there are other .append() statements that work fine?

    Thanks all!
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,153
    Rep Power
    183
    Well... I am not sure if you removed it, because it was not working or not; but right now (in your html)... you do not have a h4 in your #successfulsubmit div. Right now your html looks like this:
    Code:
        <div id="successfulsubmit">
        	<h3>&nbsp;</h3>
        	<p>&nbsp;</p>
        </div>
    Did you leave it out intentionally, because your jQuery was not working or was that an accident? Also, are you getting any error(s) in your browser's console/inspector?

IMN logo majestic logo threadwatch logo seochat tools logo