Set Text Shadow Effect with JavaScript

Sravani S
Updated on 23-Jun-2020 11:23:38

968 Views

To set the shadow effect, use the textShadow property in JavaScript.ExampleYou can try to run the following code to return the shadow effect of a text with JavaScript −           Set Text Shadow                This is Demo Text! This is Demo Text! This is This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text!                      function display() {             document.getElementById("myID").style.textShadow = "2px 2px 2px #ff0000,20px 5px 2px #F1F1F1";          }          

Delete Nth Element from Head Node Using Chash

George John
Updated on 23-Jun-2020 11:22:41

171 Views

Firstly, set a link list and add some elements.Demo list = new Demo(); list.Push(50); list.Push(100); list.Push(150);Now to delete nth element from headnode, pass what you want to delete. If you will set 1, then it will delete the head node.Exampleif (val == 1) {    head = head.Next;    return; } // n points to the node before the node we wish to delete Node n = head; // m is the node set to be deleted Node m = head.Next; for (int i = 2; i < val; i++) {    n = n.Next;    m = m.Next; } ... Read More

Set All Border Right Properties in One Declaration with JavaScript

Vikyath Ram
Updated on 23-Jun-2020 11:22:40

235 Views

To set all the border right properties in JavaScript, use the borderRight property. Set the border color, style, and, width at once using this property.ExampleYou can try to run the following code to learn how to set all the border right properties at once −Live Demo                    #box {             border: thick solid gray;             width: 300px;             height: 200px          }                     Demo Text             Change right border                function display() {             document.getElementById("box").style.borderRight = "thick solid #000000";          }          

Item Property of Hashtable Class in C#

Arjun Thakur
Updated on 23-Jun-2020 11:21:41

138 Views

Gets or sets the value associated with the specified key. You can also use the Item property to add new elements.If a key does not exist, then you can include it like −myCollection["myNonexistentKey"] = myValueThe following is the code showing how to work with Item property of Hashtable class in C#.Example Live Demousing System; using System.Collections; namespace Demo {    class Program {       static void Main(string[] args) {          Hashtable ht = new Hashtable();          ht.Add("One", "Amit");          ht.Add("Two", "Aman");          ht.Add("Three", "Raman");       ... Read More

Set Bottom Padding of an Element with JavaScript

Abhinaya
Updated on 23-Jun-2020 11:21:20

720 Views

To set the bottom padding, use the paddingBottom property in JavaScript.ExampleYou can try to run the following code to return the bottom padding of an element with JavaScript −                    #box {             border: 2px solid #FF0000;             width: 150px;             height: 70px;          }                     This is demo text.                   Bottom padding                      function display() {             document.getElementById("box").style.paddingBottom = "100px";          }          

Set Left Padding of an Element with JavaScript

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

705 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 solid #FF0000;             width: 150px;             height: 70px;          }                     This is demo text.             Left padding                function display() {             document.getElementById("box").style.paddingLeft = "100px";          }          

Set Style of Bottom Border with JavaScript

karthikeya Boyini
Updated on 23-Jun-2020 11:13:22

385 Views

To set the style of the bottom border, use the JavaScript borderBottomStyle property. It allows you to add a bottom border.ExampleYou can try to run the following code to set the style of the bottom border −           Demo Text             Click to set style of bottom border                function display() {             document.getElementById("box").style.borderBottomStyle = "dashed";          }          

Set All Four Border Radius Properties at Once with JavaScript

Lakshmi Srinivas
Updated on 23-Jun-2020 11:12:03

190 Views

To set all the border-radius properties in JavaScript, use the borderRadius property. Set the border-radius properties at once using this.ExampleYou can try to run the following code to learn how to set all the four border-radius properties −Live Demo                    #box {             border: thick solid gray;             width: 200px;             height: 200px          }                     Demo Text             Add border radius                function display() {             document.getElementById("box").style.borderRadius = "20px";          }          

Comparing Enum Members in C#

Chandu yadav
Updated on 23-Jun-2020 11:11:59

2K+ Views

To compare enum members, use the Enum.CompareTo() method.Firstly, set the values for students.enum StudentRank { Tom = 3, Henry = 2, Amit = 1 };Now use the compareTo() method to compare one enum value with another.Console.WriteLine( "{0}{1}", student1.CompareTo(student2) > 0 ? "Yes" : "No", Environment.NewLine );The following is the code to compare enum members in C#.Example Live Demousing System; public class Demo {    enum StudentRank { Tom = 3, Henry = 2, Amit = 1 };    public static void Main() {       StudentRank student1 = StudentRank.Tom;       StudentRank student2 = StudentRank.Henry;       StudentRank ... Read More

Purpose of is Operator in C#

karthikeya Boyini
Updated on 23-Jun-2020 11:10:37

266 Views

The "is" operator in C# checks whether the run-time type of an object is compatible with a given type or not.The following is the syntax.expr is typeHere, expr is the expressiontype is the name of the typeThe following is an example showing the usage of is operator in C#.Exampleusing System; class One { } class Two { } public class Demo {    public static void Test(object obj) {       One x;       Two y;       if (obj is One) {          Console.WriteLine("Class One");          x = (One)obj; ... Read More

Advertisements