Posts

Showing posts with the label JavaScript

What are two ways to enable rich text editing in your page?

What are two ways to enable rich text editing in your page? Answer: Embed an iframe containing a blank HTML page, set the "designMode" property of the iframe document object to "on". Apply the "contenteditable" attribute to an element on the page.

For a multiple select box that has multiple options selected, what does selectedIndex return?

For a multiple select box that has multiple options selected, what does selectedIndex return? Answer: The index of the first option that was selected.

What are the six events related to the clipboard?

What are the six events related to the clipboard? Answer: before copy, copy, beforecut, cut, beforepaste, paste.

What "HTML5" textbox method can be used to select some of the text?

What "HTML5" textbox method can be used to select some of the text? Answer: setSelectionRange()

What "HTML5" textbox properties can be used to get the selected text?

What "HTML5" textbox properties can be used to get the selected text? Answer: selectionStart, selectionEnd.

If multiple form controls share the same name, such as a set of radio buttons, what will the "elements" collection property of the form object return, using the common name as the index?

If multiple form controls share the same name, such as a set of radio buttons, what will the "elements" collection property of the form object return, using the common name as the index? Answer: An HTMLCollection containing all the elements with the name.

When a reset button is pressed, all of the form fields are set back to what value?

When a reset button is pressed, all of the form fields are set back to what value? Answer: The value they had when the page was first rendered.

What are three different ways to access a specific form element via JavaScript?

What are three different ways to access a specific form element via JavaScript? Assigning the form an ID and accessing via document.getElementById(). Assigning the form a name and accessing via the property of the same name on the document object. Accessing the form from the document.forms collection by index or form name attribute.