Anvi Jain has Published 569 Articles

How to set the page-break behavior inside an element with JavaScript?

Anvi Jain

Anvi Jain

Updated on 23-Jun-2020 12:35:33

3K+ Views

Use the pageBreakInside property in JavaScript to set the page-break behavior inside an element. Use the auto property to insert page break inside an element. Use auto or avoid property value to automatically insert page break inside an element, if needed, or avoid a page break, respectively.Note − The changes would be visible while ... Read More

How to create a new img tag with JQuery, with the src and id from a JavaScript object?

Anvi Jain

Anvi Jain

Updated on 23-Jun-2020 12:06:14

2K+ Views

To create a new img tag in JavaScript, pass an HTML string to the constructor, var myImg = $(''); $(document.createElement(myImg)); myImg.attr('src', responseObject.imgurl);You can also use the following code to create a new img tag with the attributes like src, id, etc −var myImg = $('', {    id: 'id1', ... Read More

How to set the left padding of an element with JavaScript?

Anvi Jain

Anvi Jain

Updated on 23-Jun-2020 11:19:22

659 Views

Use the paddingLeft property in JavaScript to set the left padding. You can try to run the following code to return the left padding of an element with JavaScript −Example                    #box {             border: 2px ... Read More

How to return the time-zone offset in minutes for the current locale?

Anvi Jain

Anvi Jain

Updated on 23-Jun-2020 08:13:23

266 Views

JavaScript date getTimezoneOffset() method returns the time-zone offset in minutes for the current locale. The time-zone offset is the minutes in difference; the Greenwich Mean Time (GMT) is relative to your local time.ExampleYou can try to run the following code to return the time-one offset in minutes −     ... Read More

With JavaScript RegExp find a character except newline?

Anvi Jain

Anvi Jain

Updated on 23-Jun-2020 07:40:33

242 Views

To find a character except for a newline, use the Metacharacter. (period). You can try to run the following code to find a character −Example           JavaScript Regular Expression                        var myStr = "We provide websites! We provide content!";          var reg = /p.o/g;          var match = myStr.match(reg);                    document.write(match);          

How objects are organized in a web document? How is it arranged in a hierarchy?

Anvi Jain

Anvi Jain

Updated on 23-Jun-2020 07:24:03

239 Views

The Objects are organized in a hierarchy. This hierarchical structure applies to the organization of objects in a Web document.Window object − Top of the hierarchy. It is the utmost element of the object hierarchy.Document object − Each HTML document that gets loaded into a window becomes a document object. ... Read More

What is the difference between custom and built-in functions in JavaScript?

Anvi Jain

Anvi Jain

Updated on 23-Jun-2020 06:00:13

661 Views

The custom functions in JavaScript are user-defined functions. JavaScript allows us to write our own functions. The following is the syntax −Syntax     Bult-in functions are functions already provided by JavaScript library, for example, the following are string functions −S. NoMethod & Description1charAt()Returns the character at the specified index.2charCodeAt()Returns ... Read More

How to write a Regular Expression in JavaScript to remove spaces?

Anvi Jain

Anvi Jain

Updated on 23-Jun-2020 05:40:28

257 Views

To remove spaces in JavaScript, you can try to run the following regular expression. It removes the spaces from a string −Example Live Demo                    var str = "Welcome to Tutorialspoint";          document.write(str);                    //Removing Spaces          document.write(""+str.replace(/\s/g, ''));                       Output

How can we insert data into an existing MySQL table by using PHP script?

Anvi Jain

Anvi Jain

Updated on 22-Jun-2020 14:03:52

607 Views

As we know that PHP provides us the function named mysql_query to insert data into an existing MySQL table.ExampleTo illustrate this we are inserting data into a table named ‘Tutorials_tbl’ with the help of PHP script in the following example −           Add New Record in MySQL Database              

How can we enter BOOLEAN values in MySQL statement?

Anvi Jain

Anvi Jain

Updated on 22-Jun-2020 12:20:04

469 Views

As we know that there is no BOOLEAN data type in MySQL hence by using TRUE or true, FALSE or false we can enter Boolean values in MySQL statement.Examplemysql> Select TRUE, FALSE; +------+-------+ | TRUE | FALSE | +------+-------+ | 1    | 0     | +------+-------+ 1 row ... Read More

Previous 1 ... 7 8 9 10 11 ... 57 Next
Advertisements