Execute a Script When a User Releases a Key in HTML

Govinda Sai
Updated on 03-Mar-2020 05:38:42

146 Views

Use the onkeyup attribute. The onkeyup attribute triggers when the user releases a key.ExampleYou can try to run the following code to execute a script on releasing a key −           Press a key inside the textbox.                      function display() {             alert("You released a key!");          }          

Create a Paragraph with Right-to-Left Direction in HTML5

Arjun Thakur
Updated on 03-Mar-2020 05:38:02

353 Views

Use the dir attribute in HTML to set a paragraph with right-to-left direction. Add the value rtl to the dir attribute for the text to be placed from right-to-left.ExampleYou can try to run the following code to implement dir attribute −           This is demo paragraph. This is demo paragraph.          This is demo paragraph. This is demo paragraph. This is demo paragraph.          This is demo paragraph. This is demo paragraph.    

Create Context Menu for an Element in HTML5

Ramu Prasad
Updated on 03-Mar-2020 05:36:48

547 Views

Use the contextmenu attribute in HTML5 to create a context menu for an element. A context menu generates when a user right-clicks. ExampleYou can try to run the following code to create a context menu −           HTML menuitem Tag                        Right click inside here....                                                                              

Execute Script on Key Press in HTML

Chandu yadav
Updated on 03-Mar-2020 05:36:03

369 Views

Use the onkeydown attribute. The onkeydown attribute triggers when the user is pressing a key.ExampleYou can try to run the following code to execute a script on pressing a key −           Press a key inside the textbox.                      function display() {             alert("You pressed a key!");          }          

Specify Form Data Encoding in HTML

radhakrishna
Updated on 03-Mar-2020 05:34:29

218 Views

Use enctype attribute in HTML to set whether the form-data should be encoded while submitting to the server.ExampleYou can try to run the following code to implement enctype attribute −           Which sports do you like?                 Football           Cricket           Hockey                    

Set Draggable Element in HTML

Jennifer Nicholas
Updated on 03-Mar-2020 05:32:47

562 Views

Use the draggable attribute to set whether the element is draggable or not. Set it using the values true and false.ExampleYou can try to run the following code to implement draggable element and drag an element −                 .drag {          float: left;          width: 100px;          height: 35px;          border: 2px dashed #876587;          margin: 15px;          padding: 10px;       }                     ... Read More

Specify Target for Downloading Hyperlink in HTML

Nikitha N
Updated on 03-Mar-2020 05:32:06

178 Views

Use the download attribute to set the file to download on click of the hyperlink. Set the value of the attribute to the name of the downloaded file, for example, image.Example           if statement in Java       The following is an image explaining the concept if if-statmement in Java (Click to download):                                

Access All Elements at Given Python List of Indexes

Pradeep Elance
Updated on 03-Mar-2020 05:31:23

344 Views

We can access the individual elements of a list using the [] brackets and the index number. But when we need to access some of the indices then we cannot apply this method. We need the below approaches to tackle this.Using two listsIn this method, along with the original list, we take the indices as another list. Then we use a for loop to iterate through the indices and supply those values to the main list for retrieving the values.Example Live Demogiven_list = ["Mon", "Tue", "Wed", "Thu", "Fri"] index_list = [1, 3, 4] # printing the lists print("Given list : ... Read More

Set Text Direction in HTML

V Jyothi
Updated on 03-Mar-2020 05:30:41

224 Views

Use the dirname attribute allows you to submit the the text direction. The value will be the name of the input followed by “.dir”.Example           Student Contact Form                Student Name:          Student Subject:                    

Set Text Direction for Content in HTML

Arjun Thakur
Updated on 03-Mar-2020 05:29:57

220 Views

Use the dir attribute in HTML, to set the text direction for the content in an element. You can try to run the following code to implement dir attribute −Example           This is demo text from left-to-right.       This is demo text from right-to-left.    

Advertisements