0

私はhtmlで試しました

 <?php while (have_posts()) :the_post(); ?>
  <div class="product-content">
   <?php if ($len > 122): ?>
   <?php echo $sub ."........"; ?>
   <p class="invisible"><?php echo $cont; ?> </p>
   <?php else: ?>
   <?php echo $sub ?>
   <?php endif; ?>
 </div>
     <?php endwhile; ?>

jqueryで

$(".product-content").click(function(){
    var t= $(this p).text();

また

$(".product-content").click(function(){
    var t= $(this ".invisible").text();
4

3 に答える 3

1

直接呼び出さないのはなぜですか?

$('.product-content').click(function(){ 
    $('.invisible').text();
});
于 2013-04-26T06:05:37.197 に答える