duanpiao6679 2017-06-04 18:51
浏览 63
已采纳

PHP到JQuery代码转换[如果没有]

How can I do it on JQuery? When I click hide, the element will be hidden, same goes for show, the element will be shown. How am I going to do it? Thanks!

<form method="POST">

<button type="submit" name="hidden" >Hide</button>
<button type="submit" name="submit" >Show</button>

</form>

<?php 

    if (isset($_POST['hidden']) == true){
        echo '*hidden*';
    } else if ($_POST['']) {
        echo 'shown';
    }

?>  
  • 写回答

4条回答 默认 最新

  • dongyun65343 2017-06-04 18:58
    关注
    $(document).ready(function(){
       $(input([name='hidden']).click(function(){
          $(this).hide();
       });
        $(input([name='submit']).click(function(){
          $(input([name='hidden']).show();
       });
    });
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)
编辑
预览

报告相同问题?