JavaScript Reference/Event Handlers Reference/onBeforeEditFocus

Материал из Web эксперт
Перейти к: навигация, поиск

"onBeforeEditFocus" Example

    
<html>
<body>
   <p contenteditable="true" 
      onbeforeeditfocus="alert("The text is prepared for editing")">
      Click in this text and type some text.
   </p>
</body>
</html>



"onBeforeEditFocus" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<a>                             <acronym>                     |
|                |<address>                       <applet>                      |
|                |<area>                          <b>                           |
|                |<bdo>                           <big>                         |
|                |<blockquote>                    <body>                        |
|                |<button>                        <center>                      |
|                |<cite>                          <code>                        |
|                |<custom>                        <dd>                          |
|                |defaults                        <del>                         |
|                |<dfn>                           <dir>                         |
|                |<div>                           <dl>                          |
|                |document                        <dt>                          |
|                |<em>                            <fieldset>                    |
|                |<font>                          <form>                        |
|                |<hn>                            <i>                           |
|                |<input type="button">           <input type="checkbox">       |
|                |<input type="file">             <inputtype="hidden">          |
|                |<input type="image">            <input type="password">       |
|                |<inputtype="radio">             <input type="reset">          |
|                |<input type="submit">           <input type="text">           |
|                |<ins>                           <isindex>                     |
|                |<kbd>                           <label>                       |
|                |<legend>                        <li>                          |
|                |<listing>                       <marquee>                     |
|                |<menu>                          <nobr>                        |
|                |<object>                        <ol>                          |
|                |<p>                             <pre>                         |
|                |<q>                             <rt>                          |
|                |<ruby>                          <s>                           |
|                |<samp>                          <select>                      |
|                |<small>                         <span>                        |
|                |<strike>                        <strong>                      |
|                |<sub>                           <sup>                         |
|                |<table>                         <td>                          |
|                |<textarea>                      <tr>                          |
|                |<tt>                            <u>                           |
|                |<ul>                            <var>                         |
|                |<xmp>                                                         |
+----------------+--------------------------------------------------------------+



"onBeforeEditFocus" Properties

+----------------+--------------------------------------------------------------+
| Properties     |altKey                          altLeft                       |
|                |cancelBubble                    clientX                       |
|                |clientY                         ctrlLeft                      |
|                |returnValue                     screenX                       |
|                |screenY                         shiftLeft                     |
|                |srcElement                      type                          |
|                |x                               y                             |
+----------------+--------------------------------------------------------------+



"onBeforeEditFocus" Syntax and Note

Note:
    
This event fires before an element enters edit mode. 
To enter edit mode, you must set its contenteditable attribute value to true.