This method uses jQuery to update a text field.
            If the new_value string ends with the newline character,
            WebDriver will finish the call, which simulates pressing
            {Enter/Return} after the text is entered.
962773
def jquery_update_text_value(self, selector, new_value, by=By.CSS_SELECTOR,
                                 timeout=settings.LARGE_TIMEOUT):
        
        if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
            timeout = self.__get_new_timeout(timeout)
        if page_utils.is_xpath_selector(selector):
            by = By.XPATH
        element = self.wait_for_element_visible(
            selector, by=by, timeout=timeout)
        self.__demo_mode_highlight_if_active(selector, by)
        self.scroll_to(selector, by=by)
        selector = self.convert_to_css_selector(selector, by=by)
        selector = self.__make_css_match_first_element_only(selector)
        selector = self.__escape_quotes_if_needed(selector)
        new_value = re.escape(new_value)
        new_value = self.__escape_quotes_if_needed(new_value)
        update_text_script = """jQuery('%s').val('%s')""" % (
            selector, new_value)
        self.safe_execute_script(update_text_script)
        if new_value.endswith('\n'):
            element.send_keys('\n')
        self.__demo_mode_pause_if_active()
1052823
function (event) {
            var domEvent = aria.DomEvent;
            if (event.keyCode === domEvent.KC_ENTER) {
                this._updateValue(false);
            }
            this.$DropDownInput._dom_onkeypress.call(this, event);
        }
1114327
function() {
    var elTextbox;
    // Bug 1802582: SF3/Mac needs a form element wrapping the input
    if(ua.webkit>420) {
        elTextbox = this.getContainerEl().appendChild(document.createElement("form")).appendChild(document.createElement("input"));
    }
    else {
        elTextbox = this.getContainerEl().appendChild(document.createElement("input"));
    }
    elTextbox.type = "text";
    this.textbox = elTextbox;

    // Save on enter by default
    // Bug: 1802582 Set up a listener on each textbox to track on keypress
    // since SF/OP can't preventDefault on keydown
    Ev.addListener(elTextbox, "keypress", function(v){
        if((v.keyCode === 13)) {
            // Prevent form submit
            YAHOO.util.Event.preventDefault(v);
            this.save();
        }
    }, this, true);

    if(this.disableBtns) {
        // By default this is no-op since enter saves by default
        this.handleDisabledBtns();
    }
}
850585
public void enterTextInWebElement(By by, String text){
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "enterTextInWebElement("+by+", \""+text+"\")");
		}
		
		if(waiter.waitForWebElement(by, 0, Timeout.getSmallTimeout(), false) == null) {
			Assert.fail("WebElement with " + webUtils.splitNameByUpperCase(by.getClass().getSimpleName()) + ": '" + by.getValue() + "' is not found!");
		}
		webUtils.enterTextIntoWebElement(by, text);
	}
610748
function () {
    var char;

    if (this.line >= this.getLines().length) {
      return false;
    }

    this.input = this.getLines()[this.line];
    this.line += 1;
    this.char = 1;
    this.from = 1;

    var inputTrimmed = this.input.trim();

    var startsWith = function () {
      return _.some(arguments, function (prefix) {
        return inputTrimmed.indexOf(prefix) === 0;
      });
    };

    var endsWith = function () {
      return _.some(arguments, function (suffix) {
        return inputTrimmed.indexOf(suffix, inputTrimmed.length - suffix.length) !== -1;
      });
    };

    // If we are ignoring linter errors, replace the input with empty string
    // if it doesn't already at least start or end a multi-line comment
    if (state.ignoreLinterErrors === true) {
      if (!startsWith("/*", "//") && !endsWith("*/")) {
        this.input = "";
      }
    }

    char = this.scanNonBreakingSpaces();
    if (char >= 0) {
      this.trigger("warning", { code: "W125", line: this.line, character: char + 1 });
    }

    this.input = this.input.replace(/\t/g, state.tab);
    char = this.scanUnsafeChars();

    if (char >= 0) {
      this.trigger("warning", { code: "W100", line: this.line, character: char });
    }

    // If there is a limit on line length, warn when lines get too
    // long.

    if (state.option.maxlen && state.option.maxlen < this.input.length) {
      var inComment = this.inComment ||
        startsWith.call(inputTrimmed, "//") ||
        startsWith.call(inputTrimmed, "/*");

      var shouldTriggerError = !inComment || !reg.maxlenException.test(inputTrimmed);

      if (shouldTriggerError) {
        this.trigger("warning", { code: "W101", line: this.line, character: this.input.length });
      }
    }

    return true;
  }
1216518
function update( element, value ) {
    var $el = $( element );
    var modelValue = unwrap( value() );
    var editorInstance = $el.data( 'froala.editor' );

    if( editorInstance == null ) {
      return;
    }

    var editorValue = editorInstance.html.get();

    // avoid any un-necessary updates
    if( editorValue !== modelValue && (typeof modelValue === 'string'  || modelValue === null)) {
      editorInstance.html.set( modelValue );
    }
  }
960086
function updateExpression(value) {

      // Rather than passing undefined to the jqLite toggle class function we explicitly set the
      // value to true. Otherwise the class will be just toggled instead of being forced.
      if (angular.isUndefined(value)) {
        value = true;
      }

      element.toggleClass('md-autofocus', !!value);
    }
1342775
public void type(String value) {
        getDispatcher().beforeType(this, value);
        
        RemoteWebElement element = getElement();
        element.clear();
        element.sendKeys(value);
        if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
            logUIActions(UIActions.ENTERED, value);
        }
        
        getDispatcher().afterType(this, value);
    }
1242322
function (event) {
            if (event.type == "dblclick" && this.controller.freeText) {
                var element = event.target;
                if (element.className.indexOf("xMultiAutoComplete_Option_Text") != -1) {
                    this._editMultiselectValue(element, event);
                }
            }
        }
886347
public void clickButtonWithText(String text) {
        String caseInsensitiveButtonText = seleniumElementService.constructCaseInsensitiveContains("text()", text);
        By buttonPpath = By.xpath("//button[" + caseInsensitiveButtonText + "]");
        String caseInsensitiveValueText = seleniumElementService.constructCaseInsensitiveContains("@value", text);
        By submitPath = By.xpath("//input[@type='submit'][" + caseInsensitiveValueText + "]");
        By inputButtonPath = By.xpath("//input[@type='button'][" + caseInsensitiveValueText + "]");
        By inputResetPath = By.xpath("//input[@type='reset'][" + caseInsensitiveValueText + "]");
        WebElement foundButton = seleniumElementService.findExpectedFirstMatchedElement(buttonPpath, submitPath, inputButtonPath, inputResetPath);
        if (foundButton == null) {
            foundButton = seleniumElementService.findExpectedFirstMatchedElement(2, buttonPpath, submitPath, inputButtonPath, inputResetPath);
        }
        foundButton.click();
    }
1028048
function (ev) {
        // If we're copying text, don't shift focus
        if (ev.ctrlKey || ev.altKey || ev.metaKey) {
            return;
        }

        // If we're typing into an input box somewhere, ignore
        var elements = ['input', 'select', 'textarea', 'button', 'datalist', 'keygen'];
        var do_not_refocus =
            elements.indexOf(ev.target.tagName.toLowerCase()) > -1 ||
            $(ev.target).attr('contenteditable');

        if (do_not_refocus) {
            return;
        }

        $('#kiwi .controlbox .inp').focus();
    }
1232910
def update(self, event=None, force=False):
        
        line_no = self.text.index(tkinter.INSERT).split(".")[0]

        # if not force:
            # if line_no == self.current_line:
#                 log.critical("no highlight line needed.")
#                 return

#         log.critical("highlight line: %s" % line_no)
#         self.current_line = line_no

        self.text.tag_remove(self.tag_current_line.id, "1.0", "end")
        self.text.tag_add(self.tag_current_line.id, "%s.0" % line_no, "%s.0+1lines" % line_no)
664265
function endTagInText(p, token) {
    if (token.tagName === $.SCRIPT) {
        p.pendingScript = p.openElements.current;
    }

    p.openElements.pop();
    p.insertionMode = p.originalInsertionMode;
}
668330
function appendText(str, isPlainText) {
		let i = newTokens.length - 1,
			last = newTokens[i]

		if (isPlainText) {
			if (lastTextWasPlain && lastPlainTextWasSpaced) {
				// Remove preceding spaces, since the last plain text
				// ended in spaces
				str = str.trimLeft()
			}

			str = str.replace(/(\s)\s+/g, '$1')
			lastPlainTextWasSpaced = /^\s$/.test(str.substr(-1))
		}
		lastTextWasPlain = isPlainText

		if (typeof last === 'string') {
			newTokens[i] += str
		} else {
			newTokens.push(str)
		}
	}
71070
void afterHtmlUpdate() {

        if (m_overlayTimer != null) {
            m_overlayTimer.cancel();
            m_overlayTimer = null;
        }
        m_runningUpdate = false;
        List<Element> elements = CmsEntityBackend.getInstance().getAttributeElements(
            m_parentEntity,
            m_attributeHandler.getAttributeName(),
            m_formParent.getElement());
        if (m_popupClosed) {
            // the form popup has already been closed, reinitialize the editing widgets for updated HTML
            CmsInlineEditOverlay.updateCurrentOverlayPosition();
            if (m_requireShowPopup) {
                if (elements.size() > m_attributeIndex) {
                    m_referenceElement = elements.get(m_attributeIndex);
                }
                showEditPopup(null);
                m_hasChanges = true;
            } else {
                CmsInlineEditOverlay.getRootOverlay().clearButtonPanel();
                m_htmlUpdateHandler.reinitWidgets(m_formParent);
            }

        } else {
            if (m_referenceElement != null) {
                CmsInlineEditOverlay.removeLastOverlay();
            }
            if (elements.size() > m_attributeIndex) {
                m_referenceElement = elements.get(m_attributeIndex);
                CmsInlineEditOverlay.addOverlayForElement(m_referenceElement);
            } else {
                m_referenceElement = m_formParent.getElement();
                CmsInlineEditOverlay.addOverlayForElement(m_referenceElement);
            }
        }
        // schedule to update the ovelay position
        m_overlayTimer = new Timer() {

            /** Timer run counter. */
            private int m_timerRuns;

            /**
             * @see com.google.gwt.user.client.Timer#run()
             */
            @Override
            public void run() {

                CmsInlineEditOverlay.updateCurrentOverlayPosition();
                if (m_timerRuns > 3) {
                    cancel();
                }
                m_timerRuns++;
            }
        };
        m_overlayTimer.scheduleRepeating(100);
    }
7489
private void updateValue(Value value) {
    while (true) {
      Value current = currentValue.get();
      if (value.isNewerThan(current)) {
        if (currentValue.compareAndSet(current, value)) {
          if (current == null || !Objects.equals(current.value(), value.value())) {
            eventListeners.forEach(listener -> listener.event(new ValueDelegateEvent<>(ValueDelegateEvent.Type.UPDATE, decode(value.value()))));
          }
          break;
        }
      } else {
        break;
      }
    }
  }
308435
function _fillInputText(element, value, next) {
        var onFilled = chainAndErrorCallback.call(this, null, next);
        var onClear = chainAndErrorCallback.call(this, function () {
            element.type(value || '', onFilled);
        }, onFilled);

        element.clear(onClear);
    }