Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Programming Scripts Articles
Page 14 of 33
How to replace values of a Python dictionary?
You can assign a dictionary value to a variable in Python using the access operator []. For example,Examplemy_dict = { 'foo': 42, 'bar': 12.5 } new_var = my_dict['foo'] print(new_var)OutputThis will give the output −42This syntax can also be used to reassign the value associated with this key. For example,Examplemy_dict = { 'foo': 42, 'bar': 12.5 } my_dict['foo'] = "Hello" print(my_dict['foo'])OutputThis will give the output −Hello
Read MoreDifference between ASP and ASP.NET
Both ASP and ASP.NET are the widely used languages for application and mainly the frontEnd development. Both the languages used for dynamic generation of web pages. The content generated through server-side scripting is then sent to the client’s web browser.Following are the important differences between ASP and ASP.NET.Sr. No.KeyASPASP.NET1DefinitionASP or also popularly known as Classic ASP developed by Microsoft is first Server-side scripting engine which is used for dynamic generation of web pages.ASP.NET, on the other hand, is a server-side web framework, open-source, which is designed for the generation of dynamic web pages.2Language typeASP is interpreted language that means the ...
Read MoreHTML5 Input type “number” in Firefox
The min attribute of the input type number isn’t supported by Firefox, but it works correctly in Google Chrome.ExampleLet us see an example − HTML input number Mention any number between 1 to 10
Read MoreCreate JS Radial gradient with matrix in HTML
JSRadial gradient with matrix is created in the following way. You can try to run the following way to create JS Radial gradient with matrix −var canvas1 = document.getElementById("canvas"); //canvas1 variable to identify given canvas var ctx1 = canvas.getContext("2d"); //This is used to tell context is 2D var gradient1 = ctx1.createRadialGradient(100/horizontalScale, 100/verticalScale, 100, 100/horizontalScale, 100/verticalScale, 0); //This will create gradient with given canvas context gradient1.addColorStop(1, "green"); //New color green is added to gradient gradient1.addColorStop(0, "red"); //New color red is added to gradient ctx1.scale(horizontalScale, verticalScale); //Context matrix ctx1 is shrinked according to horizaontal and vertical scale ...
Read MoreHow to set all the background properties in one declaration with JavaScript DOM?
To set the background in JavaScript, use the background property. It allows you to set the background color, image, position, etc.ExampleYou can try to run the following code to learn how to set all the background properties in a single declaration with JavaScript.Live Demo Click to Set background function display() { document.body.style.background = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg') repeat right top"; }
Read MoreHow to search and display the pathname part of the href attribute of an area with JavaScript?
To get the pathname part of the href attribute of an area in JavaScript, use the pathname property.ExampleYou can try to run the following code to display the pathname part. var x = document.getElementById("myarea").pathname; document.write("Pathname: "+x);
Read MoreHow to search the alternate text of an image-map area in JavaScript?
To search the alternate (alt) text of an image-map area in JavaScript, use the alt property. You can try to run the following code to get the alternate text.Example var x = document.getElementById("myarea").alt; document.write("Alternate Text: "+x);
Read MoreHow to search the value of the type attribute of a link in JavaScript?
To search the value of the type attribute of a link in JavaScript, use the type property. You can try to run the following code to get the value of type attribute.Example Qries var x = document.getElementById("qriesid").type; document.write("Value of the type attribute: "+x);
Read MoreWhat will happen when { } is converted to String in JavaScript?
Use the String() method in JavaScript to convert to String. You can try to run the following code to learn how to convert { } to String in JavaScript.ExampleLive Demo Convert {} to String var myVal = {}; document.write("String: " + String(myVal));
Read MoreHow [ ] is converted to Boolean in JavaScript?
Use the Boolean() method in JavaScript to convert to Boolean. You can try to run the following code to learn how to convert [ ] to Boolean in JavaScript.ExampleLive Demo Convert [] to Boolean var myVal = []; document.write("Boolean: " + Boolean(myVal));
Read More