user12358450
user12358450

Reputation:

How to hide the certain <span> when I link to other page?

I want to try to hide the certain when I link to other page.How to using the jquery to hide the certain span? Anyone can guide me show this problem? Thanks. Below is my coding:

Want to hide the span of the Total Record and Max 500 pages

echo "</div></div><div class='table-msg'><span id='span_hide'>Total Record : ";
echo $result->rowCount();
echo "</span><span style='margin-left: 70%;'>Max 500 pages</span></div></div>";
                ?>

Jquery function when I press the search button

    function searchData(){
            var fromDate = $("#from").val();
            var fromhr = $("#from_hours").val();
            var frommin = $("#from_minutes").val();
            var fromclock = $("#from_clock").val();
            var toDate = $("#to").val();
            var tohr = $("#to_hours").val();
            var tomin = $("#to_minutes").val();
            var toclock = $("#to_clock").val();
            //alert(fromDate+" "+toDate+" "+" "+fromhr+" "+" "+frommin+" "+" "+fromclock+" "+tohr+" "+tomin+" "+toclock);

            var sortBy1 = $("#sort1").val();
            var sortBy2 = $("#sort2").val();
            var page = $('#page').prop('checked');
            var any = $('#any').prop('checked');

            $.ajax({
                type: 'POST',
                url: '?q=filter',

                    data:{
                    fromDate: fromDate,
                    fromhr: fromhr,
                    frommin: frommin,
                    fromclock: fromclock,
                    toDate: toDate,
                    tohr: tohr,
                    tomin: tomin,
                    toclock: toclock,
                    sortBy1: sortBy1,
                    sortBy2: sortBy2,
                    page: page,
                    any: any
                },
                beforeSend: function() {
                    //show_overLay();
                    $('#tableData').html('');
                },
                success: function(data) {
                    if (data) {
                         // document.getElementById(span_hide).style.display = 'block';
                        //hide_overLay('');
                        //alert(data);
                        $("#tableData").append(data);
                        // $('#dataTable').dataTable({
                            // pageLength: 25,
                            // destroy: true
                        // });
                    } else {

                    }
                }
            });
        }

How to add hide span function when I success pass the data to url: '?q=filter'?

Below is my output when I click the search button to see the report, it will show extra the span what I want to remove:

Output

Upvotes: 1

Views: 43

Answers (1)

Illya
Illya

Reputation: 1275

Try this:

$('.table-msg').hide();

Upvotes: 1

Related Questions