- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 601 Articles for Front End Scripts
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
178 Views
The official specification states cross-origin attribute as −The crossorigin attribute is a CORS settings attribute. Its purpose is to allow images from third-party sites that allow cross-origin access to be used with canvas.When it is combined with CORS header, it would allow images defined by the element, loaded from foreign origins to be used in canvas. The procedure would be like being loaded from the current origin.You can use it to solve JavaScript errors like to log js errors −if (securityOrigin()->canRequest(targetUrl)) { msg = myError; line = myLineNumber; source = sourceURL; } else { msg = "Error!"; source = String(); line = 0; }
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
233 Views
To repopulate, use the drag and drop. This was not possible before, but now it is valid.Let us see how −function drop(ev) { ev.stopPropagation(); ev.preventDefault(); // retrieving dataTransfer field from the event var d = ev.dataTransfer; var files = d.files; handleFiles(files); }For drag and drop −// dragging target.addEventListener('dragover', (ev) => { ev.preventDefault(); body.classList.add('dragging'); }); // drag leave target.addEventListener('dragleave', () => { body.classList.remove('dragging'); }); // drop target target.addEventListener('drop', (ev) => { ev.preventDefault(); body.classList.remove('dragging'); });
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
71 Views
The elements and are useful for screenreaders as well and help visually impaired users in reading the content of your web page. These are beneficial for eBook readers as well.Let us see how to work with both the elements. HTML Section Tag Java Inheritance Inheritance defines the relationship between superclass and subclass. Learning Learn to gain experience and try to share your knowledge with others. Web Development Tutorials Consist of CSS, HTML, and PHP tutorials for 2nd Semester exams. Academic Tutorials Consist of Computer Fundamental, Computer Network tutorials for 1st Semester exams.
![Daniol Thomas](https://www.tutorialspoint.com/assets/profiles/13551/profile/60_130035-1512726078.jpg)
569 Views
To convert HTML5 canvas to PNG, follow the below-given steps −You need to add the generated data URL to the href attribute of an tag.Dialog for base64 image −Add a filename −Now define http headers −headers=Content-Disposition: attachment; filename=newimg.pngTo deal with the RAM of the web browser and make its utilization less −// generated the data URL dynamically function myCanvas() { var d = canvas.toDataURL('image/png'); this.href = d; }; d.addEventListener('click', myCanvas, false);
![Fendadis John](https://www.tutorialspoint.com/assets/profiles/13534/profile/60_64028-1512539837.jpg)
39 Views
If the content overflows, the workaround with overflowX property to solve the left/ right edge issues and set a scroll. Adding a scroll allows visitors to easily read the entire content.ExampleYou can try to run the following code to learn what is to be done with the left/ right edges of the content on overflow with JavaScript −Live Demo #box { width: 350px; height: 150px; background-color: orange; ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
191 Views
If the content renders outside the element box, use the overflow property to add a scroll. This will ease visitors in reading the entire content.ExampleYou can try to run the following code to learn how to work with overflow property in JavaScript −Live Demo #box { width: 450px; height: 150px; background-color: orange; border: 3px solid red; margin-left: 20px; ... Read More
![Arushi](https://www.tutorialspoint.com/assets/profiles/13510/profile/60_55588-1512537391.jpg)
127 Views
To set the outline style, use the outlineStyle property. The outline can be solid, dotted, dashed, etc.ExampleYou can try to run the following code to set the style of the outline around an element with JavaScript −Live Demo #box { width: 450px; background-color: orange; border: 3px solid red; margin-left: 20px; } ... Read More
![Swarali Sree](https://www.tutorialspoint.com/assets/profiles/13515/profile/60_84115-1512649510.jpg)
91 Views
To set the outline width, use the outlineWidth property. You can try to run the following code to set the width of the outline around an element with JavaScript −ExampleLive Demo #box { width: 450px; background-color: orange; border: 3px solid red; margin-left: 20px; } Click below to add Outline Width. ... Read More
![Vikyath Ram](https://www.tutorialspoint.com/assets/profiles/13780/profile/60_74413-1512648006.jpg)
96 Views
To set the outline color, use the outlineColor property. You can try to run the following code to set the color of the outline around an element with JavaScript:ExampleLive Demo #box { width: 450px; background-color: orange; border: 3px solid red; } Click below to add Outline Color. This ... Read More
![Sai Subramanyam](https://www.tutorialspoint.com/assets/profiles/13512/profile/60_68191-1512710774.jpg)
152 Views
To offset an outline, use the outlineOffsetproperty. It allows you to draw the outline beyond the border edge. You can try to run the following code to offset an outline and draw it beyond the border edge with JavaScript. Example Live Demo #box { width: 450px; background-color: orange; ... Read More