Exportar (0) Imprimir
Expandir Todos
EN
Este conteúdo não está disponível no seu idioma mas aqui tem a versão em inglês.
0 de 4 classificaram como útil - Classificar este tópico

parentTextEdit property

Retrieves the container object in the document hierarchy that can be used to create a TextRange containing the original object.

Syntax

JavaScript

p = object.parentTextEdit

Property values

Type: Object

the supported text ranges.

Remarks

The property is an object if the parent exists; otherwise, it is null. For example, the parentTextEdit property of the body is null.

Examples

This example retrieves the parent object, if needed, creates the text range, moves to the original object, and selects the first word in the object.


<script>
  function selectWord() {
    var oSource = window.event.srcElement ;
    if (!oSource.isTextEdit) 
        oSource = oSource.parentTextEdit;
    if (oSource != null) {
        var oTextRange = oSource.createTextRange();
        oTextRange.moveToElementText(window.event.srcElement);
        oTextRange.collapse();
        oTextRange.expand("word");
        oTextRange.select();
    }
  }
</script>

See also

a
abbr
acronym
address
applet
area
article
aside
b
bdo
big
blockQuote
body
br
button
caption
center
cite
code
col
colGroup
custom
dd
del
dfn
dir
div
dl
dt
em
embed
fieldSet
figcaption
figure
font
footer
form
frame
frameSet
head
header
hgroup
hn
hr
html
i
iframe
img
input type=button
input type=checkbox
input type=email
input type=file
input type=hidden
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=reset
input type=search
input type=submit
input type=tel
input type=text
input type=url
ins
isIndex
kbd
label
legend
li
listing
map
mark
marquee
menu
nav
nextID
noBR
object
ol
optGroup
option
p
plainText
pre
q
rt
ruby
s
samp
section
select
small
span
strike
strong
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
tr
tt
u
ul
var
xmp

 

 

Mostrar:
© 2014 Microsoft. Todos os direitos reservados.