f.f

A small dom/utils library for personal use.

Usage no npm install needed!

<script type="module">
  import fF from 'https://cdn.skypack.dev/f.f';
</script>

README

ff

Personal library - mostly for learning.

Usage:

Functions are namespaced according to domain.

e.g., ff.arrays.indexOf

arrays

indexOf(array, item)

classes

has(element, name)

add(element, name)

remove(element, name)

toggle(element, name)

dom

query(selector)

queryAll(selector)

each(selector, scope, function)

addAttribute(element, attribute, value)

add(element, classArray, attributeObject)

create(tagName, classArray, attributeObject)

remove(element)

append(parent, element)

appendTo(element, parent)

prepend(parent, element)

prependTo(element, parent)

insertBefore(existing, new)

insertAfter(existing, new)

parent(element, selector)

hasParent(element, parent)

empty(element)

html(element, content)

show(element)

hide(element)

toggle(element)

text(text)

events

on(element, type, function, useCapture)

off(element, type, function)

delegate(selector, type, function, scope)

objects

hasProperty(object, property)

length(object)

extend(object, arguments)

string

capitalise(string)

capitaliseAll(string)

isURL(string)

addhttp(string)

types

isElement(obj)

isString(obj)

isFunction(obj)

isArray(obj)

isObject(obj)

utils

ready(function)

now

csrfcookie

parseInt(value)

throttle(function, duration)

parameteriseURL(base, dictionary)

fade