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 6046007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:11:20+00:00 2026-05-23T07:11:20+00:00

<div rownumber=0 messageid=112 class=post style=position: relative; top: 0px;> <div class=post_body>hey hey hey</div> <div class=post_info

  • 0
<div rownumber="0" messageid="112" class="post" style="position: relative; top: 0px;">
    <div class="post_body">hey hey hey</div>
    <div class="post_info" style="top: 0px;">
        <ul>
            <li class="vote"><a href="#">vote up</a></li>
            <li class="flag"><a href="#">flag</a></li>
        </ul>
    </div>
</div>

When I click on the ‘vote up’ or ‘flag’ href links, I want to be able to grab the messageId from the main containing div element. How would I do that?

  • 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-05-23T07:11:20+00:00Added an answer on May 23, 2026 at 7:11 am
    $( 'li.vote a, li.flag a' ).click( function( e )
    {
        var msgId = $( this ).closest( 'div.post' ).attr( 'messageid' );
    
        e.preventDefault();
    } );
    

    Demo: http://jsfiddle.net/JAAulde/jQuGP/4/

    Using a data- attribute and the jQuery .data() method would be best, though, as it would comply more closely with HTML standards: http://jsfiddle.net/JAAulde/jQuGP/5/

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

Sidebar

Related Questions

<div rownumber=0 messageid=141 class=post style=position: relative; top: 0px;> <div class=post_body>testbox</div> <div class=post_info style=top: 0px;>
<div id=container> <div rownumber=0 messageid=155 class=post style=position: relative; top: 0px;> <div class=post_body><span>asdfjhasf as dfkhgfk
<div rownumber=0 messageid=29 style=margin:1px 1px 1px 1px; border:1px solid black> <input type=button value=Vote id=vote>
Div 'canvasesdiv' element contains three HTML5 canvases. <div style=position: relative; width: 400px; height: 300px;
div#thing { position: absolute; top: 0px; z-index: 2; margin: 0 auto; } <div id=thing>
Example Div: <div class=container> <div class=select1></div> <div class=select2></div> <div class=select3></div> </div> Now I want
struct Div { int i; int j; }; class A { public: A(); Div&
My div with class name 'header-body-right' doesn't seem to be floating to the left
into DIV: <div id=materialcolor></div> I must incject this dynamically generated code: <select class=groupsmaterialcolorsDDs name=group_6
I have the following div: <div class='amazingmenu' id='menupull'> <img src='images/down.png' width=20 height=20 align='right'/> <div

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.