HTML DOM ol Reversed Property

AmitDiwan
Updated on 29-Oct-2019 06:50:55

175 Views

The HTML DOM Ol reversed property sets/returns whether the order of list should be descending or ascending (default).Following is the syntax −Returning boolean value - true/falseolObject.reversedSetting reversed to booleanValueolObject.reversed = booleanValueHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that order willbe descendingfalseIt defines that order willbe ascending which is defaultLet us see an example of Ol reversed property −Example Live Demo HTML DOM Ol reversed    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    } ... Read More

HTML DOM OL Object

AmitDiwan
Updated on 29-Oct-2019 06:45:59

202 Views

The HTML DOM Ol Object in HTML represents the element.Creating a elementvar olObject = document.createElement(“OL”)Here, “olObject” can have the following properties −PropertyDescriptionreversedItsets/returns whether the order of list should be descending orascending (default)startItsets/returns the value of the start attribute of an ordered listtypeItsets/returns the value of the type attribute of an ordered listLet us see an example of Ol start property −Example Live Demo HTML DOM Ol start    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;     ... Read More

Determine Network Type: 2G, 3G, or 4G in Android

Azhar
Updated on 25-Oct-2019 08:58:41

899 Views

This example demonstrates how do I determine if network type (2G, 3G, 4G) in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.os.Bundle; import android.telephony.TelephonyManager; import android.widget.Toast; import java.util.Objects; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       getNetworkClass(getApplicationContext());    }    public ... Read More

HTML DOM Object

AmitDiwan
Updated on 25-Oct-2019 08:20:52

317 Views

The HTML DOM Object Object in HTML represents the  element.Creating an elementvar objectElement = document.createElement(“OBJECT”)Here, “objectElement” can have the following properties −PropertyDescriptiondataItsets/returns the URL of the resource being used by the objectelementformItreturns a reference to the enclosing form of the object elementheightItsets/returns the height of the object elementnameItsets/returns the name of the object elementtypeItsets/returns the content type for data downloaded via the dataattributeuseMapItsets/returns the name of a client-side image map to be used withthe object elementwidthItsets/returns the width of the object elementLet us see an example of HTML DOM Object Object property −Example Live Demo HTML DOM Object ... Read More

HTML DOM Object Form Property

AmitDiwan
Updated on 25-Oct-2019 08:15:08

226 Views

The HTML DOM Object form property returns the reference of enclosing form for element.Following is the syntax −Returning reference to the form objectObjectElement.formLet us see an example of Object form property −Example Live Demo HTML DOM Object form    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    }                    HTML-DOM-Object-form                                            var divDisplay = document.getElementById("divDisplay");    var objSelect = document.getElementById("objSelect");    function getObjectForm() {       divDisplay.textContent = 'Location of above picture: '+objSelect.form.id;    } OutputBefore clicking ‘Get location of pic in website’ button −After checking ‘Get location of pic in website’ button −

HTML DOM Object Data Property

AmitDiwan
Updated on 25-Oct-2019 08:12:24

139 Views

The HTML DOM Object data property returns a string corresponding to the value of the attribute data.Following is the syntax −Returning string valueObjectElement.dataSet data property to a string valueObjectElement.data = URLStringLet us see an example of HTML DOM Object data property −Example Live Demo HTML DOM Object data    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    }                    HTML-DOM-Object-data                                                          var divDisplay = document.getElementById("divDisplay");    var objSelect = document.getElementById("objSelect");    function getObjectData() {       objSelect.data       divDisplay.textContent = 'URL of above picture: '+objSelect.data;    } OutputBefore clicking ‘Get URL’ button −After clicking ‘Get URL’ button −

HTML DOM Navigation Object

AmitDiwan
Updated on 25-Oct-2019 07:34:16

248 Views

The HTML DOM Nav Object in HTML represents a element.Let us see an example of HTML DOM Nav object −Example Live Demo HTML DOM Nav    * {       padding: 2px;       margin:5px;    }       form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;    }                    HTML-DOM-Nav                         ... Read More

HTML DOM MouseEvent Object

AmitDiwan
Updated on 25-Oct-2019 07:20:32

441 Views

The HTML DOM MouseEvent Object represents an event which incurs on interaction of mouse with the HTML document elements.Here, “MouseEvent” can have the following properties and methods −Property/MethodDescriptionaltKeyItreturns whether the "ALT" key on keyboard was pressedwhen the mouse event was triggeredbuttonItreturns a number corresponding to which mouse button was pressedwhen the mouse event was triggeredbuttonsItreturns which mouse buttons were pressed when the mouse event wastriggeredclientXItreturns the horizontal (x) coordinate of the mouse pointer, relative to the current window, when the mouse event was triggeredclientYItreturns the vertical (y) coordinate of the mouse pointer, relativeto the current window, when the mouse event ... Read More

HTML DOM MouseEvent screenY Property

AmitDiwan
Updated on 25-Oct-2019 06:54:17

108 Views

The HTML DOM MouseEvent screenY property returns the vertical (y) coordinate of the mouse pointer relative to the users screen display if a mouse event was triggered. Use with screenY to get the horizontal coordinate as well.Following is the syntax −Returning reference to the screenY objectMouseEventObject.screenYLet us see an example of MouseEvent screenY property −Example Live Demo MouseEvent screenY    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    #outer {     ... Read More

Find Amount to be Added to Achieve Target Ratio in a Given Mixture in C++

Arnab Chakraborty
Updated on 24-Oct-2019 14:12:49

86 Views

Suppose we have a container with size X. It has a mixture of water and other liquid, the mixture has W% of water in it. We have to find how many water must be added to increase the ratio of water to Y%? If X = 125, W = 20 and Y = 25, then output will be 8.33 liters.Suppose we have to add A amount of water with the previous mixture, so new amount will be X + A. So the amount of water in the mixture will follow this formula.Old Amount+A=((W% of X) + A)Also the amount of ... Read More

Advertisements