Share via


ImgElement Object Members

SharePoint Designer Developer Reference

Represents an individual IMG element in an HTML document.

Methods

  Name Description
contains Returns a Boolean that represents whether an element is contained within another element. True indicates that the element specified in the pChild parameter is contained within an IMG element.
getAttribute Returns a Variant that represents the value of the specified attribute.
getBotAttribute Returns a Variant that represents a Web component inserted into a Web page.
insertAdjacentHTML Inserts HTML text into an IMG element at the specified location.
insertAdjacentText Inserts text into an IMG element at the specified location.
removeAttribute Returns a Boolean that represents whether the attribute was successfully removed. True indicates that the attribute was removed. False indicates that the attribute was not removed.
removeBotAttribute Removes the attribute specified by the strAttributeName parameter. Returns a Boolean that represents whether the attribute was removed. True indicates the attribute was successfully removed.
scrollIntoView Scrolls the page so that an IMG element is positioned at the top of the page window.
setAttribute Sets the attribute for an IMG element.
setBotAttribute Sets an attribute for a Web component.

Properties

  Name Description
accessKey Sets or returns a String that represents the shortcut key, also known as the accelerator key, for a specified object.
align Sets or returns a String that represents how an object is aligned with adjacent text.
all Returns an ElementCollection object that represents a reference to the collection of all elements contained within a specified object.
alt Sets or returns a String that represents the text to display as an alternative to a graphic.
border Returns or sets a Variant that represents the border width in pixels of an IMG element.
children Returns an ElementCollection collection that represents a collection of elements that are direct descendants of an IMG element.
className Returns or sets a String that indicates the CSS style rule for an IMG element. Corresponds to the class attribute.
clientHeight Returns a Long that represents the height in pixels of an IMG element without any margin, border, scroll bar, or padding settings that may have been applied.
clientLeft Returns a Long that represents the position in pixels of the left edge of an IMG element without any margin, border, scroll bar, or padding settings that may have been applied.
clientTop Returns a Long that represents the distance in pixels between the offsetTop property and the true top of the client area of an IMG element.
clientWidth Returns a Long that represents the width in pixels of an IMG element without any margin, border, scroll bar, or padding settings that may have been applied.
complete Returns a Boolean that represents whether a specified object is fully loaded.
dataFld Sets or returns a String that represents the name of the field in a data source, as specified by the dataSrc property, to which to bind the specified object. Corresponds to the dataFld attribute for an IMG element.
dataFormatAs Sets or returns a String that contains the value of the dataFormatAs attribute, which represents how to render the data supplied to a specified object. Corresponds to the dataFormatAs attribute for an IMG element.
dataSrc Sets or returns a String that represents the data source from which an ImgElement object gets or sets its data.
document Returns an Object that represents the parent document for an IMG element.
dynsrc Sets or returns a String that represents the address of a video clip or VRML world to be displayed in an IMG element.
fileCreatedDate Retrieves a String that represents the date an image file was created.
fileModifiedDate Retrieves a String that represents the date an image file was last modified.
fileSize Returns a String that represents the file size in bytes.
fileUpdatedDate Retrieves a String that represents the date when an image file was last updated.
height Returns or sets a String that represents the height of an IMG element. Corresponds to the height attribute.
href Returns or sets a String that represents the URL that the browser uses to locate the image or video clip associated with the element.
hspace Returns or sets a Long that represents the horizontal margin for an IMG element. Corresponds to the hspace attribute.
id Returns or sets a String that represents the value of the id attribute for an IMG element.
innerHTML Sets or returns a String that represents the text and HTML elements between the start and end tags of an IMG element.
innerText Sets or returns a String that represents the text between the start and end tags of an IMG element without any associated HTML.
isMap Returns or sets a Boolean that represents whether the image uses an image map stored on the Web server. True indicates that the image uses a server-side map. Corresponds to the ismap attribute of an IMG element.
isTextEdit Returns a Boolean that represents whether you can create a TextRange object with an ImgElement object. True indicates that you can create a TextRange object.
lang Returns or sets a String that represents the language to use for the specified object. Corresponds to the lang attribute of the associated HTML element.
language Returns or sets a String that represents the language in which the script for an IMG element is written.
loop Sets or returns an Integer that represents the number of times a video clip will loop when activated. Corresponds to the loop attribute.
lowsrc Sets or returns a String that represents a lower resolution image to display. Corresponds to the lowsrc attribute.
name Returns or sets a String that represents the name of an IMG element that can be used to access the element in scripts. Corresponds to the name attribute.
offsetHeight Retrieves the height of the specified object relative to the layout or coordinate parent, as indicated in the offsetParent property.
offsetLeft Retrieves the left edge of the specified object relative to the layout or coordinate parent, as indicated in the offsetParent property.
offsetParent Retrurns an IHTMLElement object that represents the parent element that defines the offsetTop and offsetLeft properties.
offsetTop Retrieves the top edge of the specified object relative to the layout or coordinate parent, as indicated in the offsetParent property.
offsetWidth Retrieves the width of the specified object relative to the layout or coordinate parent, as indicated in the offsetParent property.
onclick Sets or returns a Variant that represents the value of the onclick attribute, which is the script that runs when the onclick event fires.
ondblclick Returns or sets a Variant that represents the value of the ondblclick attribute, which is the script that runs when the ondblclick event fires.
ondragstart Returns or sets a Variant that represents the value of the ondragstart attribute, which is the script that runs when the ondragstart event fires.
onkeydown Returns or sets a Variant that represents the value of the onkeydown attribute, which is the script that runs when the onkeydown event fires.
onkeyup Returns or sets a Variant that represents the value of the onkeyup attribute, which is the script that runs when the onkeyup event fires.
onmousedown Returns or sets a Variant that represents the value of the onmousedown attribute, which is the script that runs when the onmousedown event fires.
onmousemove Returns or sets a Variant that represents the value of the onmousemove attribute, which is the script that runs when the onmousemove event fires.
onmouseout Returns or sets a Variant that represents the value of the onmouseout attribute, which is the script that runs when the onmouseout event fires.
onmouseover Returns or sets a Variant that represents the value of the onmouseover attribute, which is the script that runs when the onmouseover event fires.
onmouseup Returns or sets a Variant that represents the value of the onmouseup attribute, which is the script that runs when the onmouseup event fires.
onresize Returns or sets a Variant that represents the value of the onresize attribute, which is the script that runs when the onresize event fires.
onselectstart Returns or sets a Variant that represents the value of the onselectstart attribute, which is the script that runs when the onselectstart event fires.
outerHTML Returns or sets a String that represents the HTML for an IMG element and all text and HTML that it contains, including the surrounding start and end tags.
outerText Returns or sets a String that represents the text, without any HTML, of an IMG element.
parentElement Returns an IHTMLElement that represents the element that is one level up in the HTML element hierarchy.
parentTextEdit Returns an IHTMLElement object that represents the parent element in the document hierarchy that can be used to create a text range containing the original element.
protocol Returns a String that represents how a document is accessed.
readyState Returns a String that represents the state of the specified object.
sourceIndex Returns a Long that represents the ordinal position of the element, in source order, as the element appears in the ElementCollection collection accessed by using the all property.
src Returns or sets a String that represents the source file for an IMG element. Corresponds with the src attribute.
Start Sets or returns a String that represents when a video clip file should begin playing.
Style Returns an Style object that represents the inline style properties for an IMG element. Corresponds to the style attribute.
tabIndex Sets or returns an Integer that represents the position of an element within the tab selection order.
tagName Returns a String that represents the name of an IMG element.
title Sets or returns a String that represents the value of a ScreenTip for an IMG element.
useMap Sets or returns a String that represents the name, often with a bookmark extension (#name), to use as a client-side image map for an image.
vrml Sets or returns a String that represents the URL of the virtual reality modeling language (VRML) world to be displayed in the window.
vspace Sets or returns a Long that represents the vertical margin for an element.
width Sets or returns a Long that represents the width of an image. Corresponds to the width attribute for an IMG element.

Events

  Name Description
onclick Occurs when a user clicks on an IMG element.
ondblclick Occurs when a user double-clicks on an IMG element.
ondragstart Occurs when the user starts to drag an IMG element.
onkeydown Occurs when a users presses a key on the keyboard.
onkeyup Occurs when a user releases a key.
onmousedown Occurs when a user clicks an IMG element with either mouse button.
onmousemove Occurs when the user moves the mouse pointer over an IMG element.
onmouseout Occurs when a user moves the mouse pointer outside the boundaries of an IMG element.
onmouseover Occurs when a user moves the mouse pointer over an IMG element.
onmouseup Occurs when a user releases a mouse button.
onresize Occurs before an IMG element is resized.
onselectstart Occurs when a user starts selecting an IMG element.