0
<html>
<head>
<script type="text/javascript" src="js/jquery-1.4.3.min.js"></script>

<script>$('.countryclassinfolink').click(function(event) {
        event.preventDefault();
        var detailinfo = $(this).parent().next().html();
        $('#country_details').html(detailinfo);
        $('.countryclassinfolink2').click(function(event) {
            event.preventDefault();
            $('#country_details').html('');
            $('#country_details').hide();
            $('#country_seminars').fadeIn();
        });
        $('#country_seminars').hide();
        $('#country_details').fadeIn();
    });
</script>
</head><body>
<div class="section seminars">
  <h2><span>USA Seminars</span></h2>
  <div id="country_seminars" class="body">
    <table>
      <tbody>
        <tr>
          <td class="practioners"><p> <span class="date">06/10/2013</span> Niskayuna, NY<br>
              <a class="countryclassinfolink" href="#">Advanced DNA</a> </p>
            <div style="display:none;" id="classdetails26436">
              <div class="searchresults result" style="border-bottom: none;width:650px;"><a style="float:right;" class="countryclassinfolink2" href="#">Return</a>
                <div class="resultheader">
                  <div style="background-image:none;float:none;" class="name">Advanced DNA</div>
                  <div style="background-image:none;" class="name">Anana Integre</div>
                  <div class="icon"><img src="images/practitioner-icon.gif"></div>
                  <div class="icon"><img src="images/instructor-icon.gif"></div>
                </div>
                <div class="image"><img border="0" alt="" src="/images/specialistImages/thumb_1294779133.jpg"></div>
                <div style="width: 400px;" class="info">
                  <table>
                    <tbody>
                      <tr>
                        <td style="border:0;">Niskayuna, NY<br>
                          <strong>Phone:</strong><br>
                          831-246-1790<br>
                          <strong>Email:</strong><br>
                          <a href="mailTo:miraclewrkr@gmail.com">miraclewrkr@gmail.com</a><br>
                          <strong>Website:</strong><br>
                          <a target="_blank" href="http://www.thetahealingwitness.com">www.thetahealingwitness.com</a><br>
                          <strong>Cost:</strong><br>
                          $&nbsp;575.00<br>
                          <strong>Notes:</strong><br>
                          <br></td>
                        <td style="border:0;"><strong>Dates:</strong><br>
                          06/10/2013<br>
                          06/12/2013<br></td>
                      </tr>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
            </td>
          <td class="filler"></td>
        </tr>
      </tbody>
    </table>
  </div>
  <div style="display: none;" id="country_details" class="body"></div>
  <div class="bottom">&nbsp;</div>
</div>
</body></html>
3
Contributors
4
Replies
21
Views
4 Years
Discussion Span
Last Post by radhakrishna.p
0

Without any description of what happens, or what should happen, just dumping some script and expecting answers is not going to work.

0

Dear Pritaeas

There is a link with class(<a class="countryclassinfolink" href="#">Advanced DNA</a>)
on click on it all data of next element will be copy and append in div(id='country_details')

But it is not work

2

I think you should bind the click event in the document ready event. Looks like you are executing your code too early.

0

hai vishal.du123,

as pritaeas said, please make your script code from this

<script>$('.countryclassinfolink').click(function(event) {
event.preventDefault();
var detailinfo = $(this).parent().next().html();
$('#country_details').html(detailinfo);
$('.countryclassinfolink2').click(function(event) {
event.preventDefault();
$('#country_details').html('');
$('#country_details').hide();
$('#country_seminars').fadeIn();
});
$('#country_seminars').hide();
$('#country_details').fadeIn();
});
</script>

to this

<script type="text/javascript">
$(document).ready(function(){

$('.countryclassinfolink').click(function(event) {
    event.preventDefault();
    var detailinfo = $(this).parent().next().html();
    $('#country_details').html(detailinfo);
    $('.countryclassinfolink2').click(function(event) {
            event.preventDefault();
            $('#country_details').html('');
            $('#country_details').hide();
            $('#country_seminars').fadeIn();
    });
    $('#country_seminars').hide();
    $('#country_details').fadeIn();
});
});

</script>

you missed $(document).ready() function to initiate the your desired ccall

thats it

happy coding

Edited by radhakrishna.p: providing clarity on the solution

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.