How do I hide a specific element in jQuery?

Posted on 2014-08-29
Last Modified: 2014-08-29
Hi all,

Could anyone please help me hide the last <p> element inside this div using jQuery. I'm going nuts. Tried everything, nth-child, eq(), etc. Noting seems to work:

<div class="inside">
<input id="wpclubmanager_meta_nonce" name="wpclubmanager_meta_nonce" value="0f6697b2fe" type="hidden"><input name="_wp_http_referer" value="/wp-admin/post.php?post=179&amp;action=edit" type="hidden">
			<label class="selectit">
				<input name="wpcm_played" id="wpcm_played" value="1" type="checkbox">
				Risultato			</label>
		<div style="display: none;" id="results-table">
		<tr class="wpcm-ss-admin-tr-last">
			<th align="right">Half Time</th>
			<td><input name="wpcm_goals[q1][home]" id="wpcm_goals_q1_home" value="0" size="3" type="text"></td>
			<td><input name="wpcm_goals[q1][away]" id="wpcm_goals_q1_away" value="0" size="3" type="text"></td>

						<th align="right">Punteggio</th>
						<td><input name="wpcm_goals[total][home]" id="wpcm_goals_total_home" value="0" size="3" type="text"></td>
						<td><input name="wpcm_goals[total][away]" id="wpcm_goals_total_away" value="0" size="3" type="text"></td>
			<label class="selectit">
				<input name="wpcm_friendly" id="wpcm_friendly" value="1" type="checkbox">
				Amichevole			</label>


Open in new window

Question by:badwolfff
    1 Comment
    LVL 81

    Accepted Solution

    use <<  :last >>
    $(".inside p:last").hide();

    test page :

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
    JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now