nextElement

Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.query

Browse the passed element next siblings to find the first element that matches the passed selector

Params

  1. $elm*-HTMLElement

    The element to start on

  2. selector*-String

    A css selector to search for

Return

  1. -HTMLElement|undefined

    Element found or undefined

Example

import { nextElement } from '@blackbyte/sugar/dom'
const nextElm =  nextElement($elm, '.my-cool-class');
if (nextElm) {
  // we have found en element that matches the selector
}

Todo

  • testsnormal