video pop js
Here is what the above code is Doing:
1. We’re creating a button with the class js-modal-btn.
2. We’re adding a data attribute called data-video-id.
3. We’re giving the data attribute a value of q-mw1yB0Gmk.
Here is what the above code is Doing:
1. We’re creating a button with the class js-modal-btn.
2. We’re adding a data attribute called data-video-id.
3. We’re giving the data attribute a value of q-mw1yB0Gmk.
const table = $(‘#example’).DataTable(); // Get the column API object const column = table.column( 2 ); // gets 2nd column (0-indexed) // Toggle the visibility column.visible( ! column.visible() ); // true or false Here is what the above code is Doing: 1. Select the table element 2. Get the DataTable object 3. Get the column…
function incrementValue() { var value = parseInt(document.getElementById(‘number’).value, 10); value = isNaN(value) ? 0 : value; value++; document.getElementById(‘number’).value = value; } Here is what the above code is Doing: 1. We are creating a function called incrementValue() 2. We are getting the value of the input field with the id of number 3. We are converting…
let arr = [ [1, 2], [3, 4], [5, 6][7, 8, 9], [10, 11, 12, 13, 14, 15] ]; let flatArray = arr.reduce((acc, curVal) => { return acc.concat(curVal) }, []); //Output: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ] Here is what the above code is…
string.replace(‘find1’, ‘replace1’).replace(‘find2’, ‘replace2′); Here is what the above code is Doing: 1. The first replace() call replaces ‘find1’ with ‘replace1’. 2. The second replace() call replaces ‘find2’ with ‘replace2’. 3. The result of the second replace() call is returned.
var oneMonthAgo = new Date( new Date().getFullYear(), new Date().getMonth() – 1, new Date().getDate() ); console.log(oneMonthAgo); //$uj@y Here is what the above code is Doing: 1. Create a new Date object with the current year, month, and day. 2. Subtract one month from the current month. 3. Create a new Date object with the current year,…
window.onscroll = function() { document.getElementById(‘id’).style.margin = ’40px 0 0 0′ } Here is what the above code is Doing: 1. We’re creating a function that will be called when the user scrolls the page. 2. We’re selecting the element with the id of id. 3. We’re changing the margin of the element to 40px 0…