Print Date in Regular Format in Python

Rajendra Dharmkar
Updated on 12-Jun-2020 13:07:55

2K+ Views

If you print the dates directly using a print function, you'd get regular dates,  Exampleimport datetime today = datetime.date.today() print(today)OutputYou will get the output −2018-1-2which is exactly what you want. But when you append this to a list and then try to print it,   Exampleimport datetime my_list = [] today = datetime.date.today() my_list.append(today) print(my_list)OutputYou will get the output −[datetime.date(2018, 1, 2)]This is happening because datetimes are objects. Therefore, when you manipulate them, you manipulate objects, not strings, not timestamps nor anything. Any object in Python have TWO string representations. The regular representation that is used by "print", can be get ... Read More

Find Anchor Tag in Div and Add Class Using jQuery

Ricky Barnes
Updated on 12-Jun-2020 13:02:21

3K+ Views

To find anchor tag in div, use a selector and the addClass() method adds a class using jQuery.You can try to run the following code to learn how to find anchor tag in div and add class:Live Demo                          $(document).ready(function(){            $("#button1").click(function(){              $('#div1 a').addClass('myclass');            });         });                                 .myclass {              font-size: 25px;            }                                  Demo                      This is demo text.             Click    

Bootstrap Contextual Classes

Arjun Thakur
Updated on 12-Jun-2020 12:53:55

2K+ Views

The Bootstrap Contextual Class allows you to change the background color of your table rows or individual cells.The following are the classes −ClassDescription.activeApplies the hover color to a particular row or cell.successIndicates a successful or positive action.warningIndicates a warning that might need attention.dangerIndicates a dangerous or potentially negative actionExampleThe following is an example of the active class −ExampleLive Demo           Bootstrap Table                                                                      Subject                Marks                Student                                                            Maths                90                Amit                                        Science                80                Aman                                        English                85                Rahul                                

Get Selected Text from Drop Down List using jQuery

Ricky Barnes
Updated on 12-Jun-2020 12:50:48

1K+ Views

With jQuery, it’s easy to get selected text from a drop-down list with :selected. This is done using the select id. You can try to run the following code to learn how to get selected text from a drop-down list using jQuery −ExampleLive Demo           jQuery Selector                      $(document).ready(function() {             $("#submit").click(function(){                      $("#myselection option:selected").text();                alert( $("#myselection option:selected").text() );             });          });                              The selected value:                   First           Second                 Result              

Bootstrap Table Responsive Class

Chandu yadav
Updated on 12-Jun-2020 12:50:07

2K+ Views

Wrapping any .table in .table-responsive class, you will make the table scroll horizontally up to small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.To make a responsive table, you can try to run the following code −ExampleLive Demo           Bootstrap Table                                                                                         Subject                   Marks                   Student                                                                  Programming                90                Amit                                        Web Dev                92                Yuvraj                                        Science                95                Sachin                                        Economics                80                Tony                                

Make Table Responsive Using the Table Responsive Class

Arjun Thakur
Updated on 12-Jun-2020 12:48:54

292 Views

To make a table responsive with Bootstrap, you can try to run the following code &miuns;ExampleLive Demo           Bootstrap Table                                                                                         Subject                   Marks                   Student                                                                           Programming                   90                   Amit                                                   Web Dev                   92                   Yuvraj                                                   Science                   95                   Sachin                                                   Economics                   80                   Tony                                                

Check If an Element is Hidden in jQuery

Ricky Barnes
Updated on 12-Jun-2020 12:48:51

247 Views

Using jQuery, you can detect if a specific element in the page is hidden or visible with is(:visible). You can try to run the following code to learn how to check if an element is hidden in jQuery or not −ExampleLive Demo           jQuery Selector                      $(document).ready(function() {          $("#button1").click(function(){            var visible = $('#myElement').is(':visible');                      if(visible) {               alert("input element is visible");                    }            else            {               alert("input element is hidden");            }          });         });                                     Check Visibility    

Bootstrap Input Group XS

Ankith Reddy
Updated on 12-Jun-2020 12:47:32

539 Views

To make extra small input group, use the input-group-xs.You can try to run the following code to implement the input-group-xs class in Bootstrap −ExampleLive Demo           Bootstrap Example                                                                      $                                                

Select Element by ID Attribute Using jQuery

Ricky Barnes
Updated on 12-Jun-2020 12:46:54

459 Views

The element ID selector selects a single element with the given id attributes. Here’s how you can select:$('#elementid')You can try to run the following code to learn how to select an element by its ID attribute using jQuery:Live Demo           jQuery Selector                      $(document).ready(function() {             $("#div2").css("background-color", "yellow");          });                              This is first division of the DOM.                      This is second division of the DOM.                      This is third division of the DOM          

Apply Hover Color to Table Row or Cell with Bootstrap

Chandu yadav
Updated on 12-Jun-2020 12:46:00

494 Views

To apply hover color to a particular table row or cell with Bootstrap, use the .active class. You can try to run the following code to implement the .active class −ExampleLive Demo           Bootstrap Table                                                                                         Subject                   Marks                   Type                                                                           C++                   70                   Programming Language                                                   PHP                   92                   Scripting Language                                                   jQuery                   80                   JavaScript Library                                                

Advertisements