Javascript Articles - Page 444 of 534

HTML5 Input type=number removes leading zero

Lakshmi Srinivas
Updated on 25-Jun-2020 06:16:28

5K+ Views

The leading zero issues may arise when you want to add an international phone number.To solve this −On iOS, the numeric keyboard appears with only numbers.On Android phones, the "tel" is rightly interpreted but not the pattern.You can also use −

How to put the WebBrowser control into IE9 into standards with HTML?

Arjun Thakur
Updated on 25-Jun-2020 06:17:19

169 Views

To place the WebBrowser control into IE9 standards, you need to add the following line in your HTML web page −You can also try this for Internet Explorer 9 −You can also try this for Microsoft Edge −

What is the correct use of schema.org SiteNavigationElement in HTML?

Daniol Thomas
Updated on 27-Jan-2020 07:27:04

834 Views

The schema.org SiteNavigationElement extends WebPageElement. It is used to mark-up links that would make amazing contextual links.                    Home page                              My demo page          

How to “enable” HTML5 elements in IE 8 that were inserted by AJAX call?

George John
Updated on 27-Jan-2020 07:26:37

341 Views

To enable HTML5 elements in IE, you need to use plugins like html5shiv. The HTML5 Shiv enables use of HTML5 sectioning elements in legacy Internet Explorer and provides basic HTML5 styling for Internet Explorer 6-9,With that, you can also use document.createElement to create an element.var demo = document.createElement("demo"); demo.innerHTML = "Working!"; document.appendChild(demo);

How to either determine SVG text box width or force line breaks after 'x' characters?

Krantik Chavan
Updated on 27-Jan-2020 07:26:08

296 Views

Use the getBBox() function and add a single word at a time to a text object. When it gets too wide, you need to add a line feed.var a = Raphael(500, 500); var b = a.text(100, 100).attr('text-anchor', 'start'); var maxWidth = 100; var content = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis nec semper mauris. Sed gravida augue feugiat nulla ultrices efficitur. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed sit amet lobortis eros, et lobortis diam. Aenean arcu velit, condimentum eu lacus in, dignissim bibendum odio. Mauris ultricies nunc et lorem ... Read More

How to get a key/value data set from a HTML form?

Nishtha Thakur
Updated on 25-Jun-2020 06:19:04

1K+ Views

To get a key/ value data set from a HTML form, use jQuery.Let us say this is our HTML −     For JS −var data = $('form#form1’).serializeArray(); // [{'demo: 'value'}] $.ajax({    data: data });

How to save HTML5 canvas data to file?

George John
Updated on 27-Jan-2020 07:08:50

602 Views

Use PNGStream to save HTML5 canvas to file.var f = require('fs') , out = f.createWriteStream(__dirname + '/text.png') , stream = canvas.pngStream(); stream.on('data', function(chunk){    out.write(chunk); }); stream.on('end', function(){    console.log(‘PNG Saved successfully!’); });

Which browsers support the HTML5 History API?

Samual Sam
Updated on 27-Jan-2020 07:07:22

251 Views

The WebKit-based browsers and Firefox 4 mainly supports the HTML5 History API. However, now almost every modern browser supports it.Firefox 4+Google ChromeInternet Explorer 10+Safari 5+iOS 4

Setting null values with an HTML