removeElementChildren

Removes the child elements of the specified element corresponding to the specified tag.

Syntax

removeElementChildren = function(aElement, aTagName);

Parameters

  • aElement
    • function: target element
  • aTagName
    • function: tag of elements to delete

Notes

  • If aTagName is an empty string, it will be deleted all child elements.

Examples

  1. //Загружаем страницу google.ru с запросом
    loadURI('https://www.google.ru/#newwindow=1&q=test+request');
    //Get the first element h3
    var element = getElement('h3', 0);
    //Remove the child links
    removeElementChildren(element,'a');