# Class: Faquery

## Faquery ()

#### new Faquery()

Approximates a subset of jQuery functionality.

This class exists to support jQuery-like methods within the existing web
components.

**Note:** New web components should be written using native accessors
instead of the undocumented methods of this class. The methods are
designed for backward compatibility with older code that used jQuery;
they are not intended for direct API use.

Since:  
- 8.1.0

### Methods

#### addClass(classes)

Add css classes.

##### Parameters:

| Name      | Type                       | Description                                          |
|-----------|----------------------------|------------------------------------------------------|
| `classes` | string \| Array.\<string\> | List of classes, either space delimited or an array. |

##### Returns:

Returns itself.

Type  
[Faquery](Faquery.html)

#### append(content, invalid)

Append DOM elements.

##### Parameters:

| Name      | Type                                                                                          | Description                                                                  |
|-----------|-----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| `content` | string \| Array.\<string\> \| [Faquery](Faquery.html) \| HTMLElement \| Array.\<HTMLElement\> | DOM to append. If a string, will set inner content.                          |
| `invalid` | undefined                                                                                     | Not used. Faquery.append does not accept a second argument like jQuery does. |

##### Returns:

Returns itself

Type  
[Faquery](Faquery.html)

#### attr(nameOrObject \[, value\])

Set/Get HTML attributes. If first parameter is an object, this method
will set the attributes in the keys to their respective values. If first
parameter is a string, and second parameter is not undefined, attribute
specified in first parameter will be set to value in second. If first
parameter is a string, and second parameter is undefined, function will
return existing attribute value.

##### Parameters:

| Name           | Type             | Argument     | Description                                                                                  |
|----------------|------------------|--------------|----------------------------------------------------------------------------------------------|
| `nameOrObject` | string \| object |              | Attribute name or an object with name-value pairs.                                           |
| `value`        | string           | \<optional\> | If supplied, will set the attribute whose name is specified in `nameOrObject` (if a string). |

##### Returns:

Returns itself if setting an attribute, or the attribute's value if
getting an attribute.

Type  
[Faquery](Faquery.html) \| string

#### children(selector)

Get child elements.

##### Parameters:

| Name       | Type   | Description                   |
|------------|--------|-------------------------------|
| `selector` | string | Selector for children to get. |

##### Returns:

Returns children.

Type  
[Faquery](Faquery.html)

#### css(nameOrObject \[, value\])

Set/Get element css styles. If first parameter is an object, this method
will set the styles in the keys to their respective values. If first
parameter is a string, and second parameter is not undefined, style
specified in first parameter will be set to value in second. If first
parameter is a string, and second parameter is undefined, function will
return existing style value.

##### Parameters:

| Name           | Type             | Argument     | Description                                                                                 |
|----------------|------------------|--------------|---------------------------------------------------------------------------------------------|
| `nameOrObject` | string \| object |              | Style property name or an object with name-value pairs.                                     |
| `value`        | string           | \<optional\> | If supplied, will set the property whose name is specified in `nameOrObject` (if a string). |

##### Returns:

Returns itself if setting a property, or the property's value if getting
a property.

Type  
[Faquery](Faquery.html) \| string

#### each(func)

Call a function on each element.

##### Parameters:

| Name   | Type     | Description                                                                                                                             |
|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------------|
| `func` | function | Function to call. Signature is: first parameter is the index, second is the element. `this` is available as the element being iterated. |

##### Returns:

Returns itself.

Type  
[Faquery](Faquery.html)

#### empty()

Remove content from element(s).

##### Returns:

Returns itself.

Type  
[Faquery](Faquery.html)

#### find(selector)

Find descendant elements.

##### Parameters:

| Name       | Type   | Description                      |
|------------|--------|----------------------------------|
| `selector` | string | Selector for descendants to get. |

##### Returns:

Returns descendants.

Type  
[Faquery](Faquery.html)

#### hasClass(className)

Test if any element contains a class.

##### Parameters:

| Name        | Type   | Description            |
|-------------|--------|------------------------|
| `className` | string | Name of class to test. |

##### Returns:

True if at least one element has the class.

Type  
boolean

#### hide()

Hide DOM element(s). Display style is set to "none".

##### Returns:

Returns itself.

Type  
[Faquery](Faquery.html)

#### html( \[value\])

Set/Get inner HTML. If `value` not supplied, will return innerHTML.

##### Parameters:

| Name    | Type   | Argument     | Description                            |
|---------|--------|--------------|----------------------------------------|
| `value` | string | \<optional\> | If setting, value to set innerHTML to. |

##### Returns:

Returns itself if setting, or innerHTML if getting.

Type  
[Faquery](Faquery.html) \| string

#### nextAll(selector)

Find subsequent sibling elements.

##### Parameters:

| Name       | Type   | Description                   |
|------------|--------|-------------------------------|
| `selector` | string | Selector for siblings to get. |

##### Returns:

Returns subsequent siblings.

Type  
[Faquery](Faquery.html)

#### not(selector)

Get nonmatching elements.

##### Parameters:

| Name       | Type   | Description                    |
|------------|--------|--------------------------------|
| `selector` | string | Selector for elements to omit. |

##### Returns:

Returns nonmatching elements.

Type  
[Faquery](Faquery.html)

#### parent(selector)

Get parent elements.

##### Parameters:

| Name       | Type   | Description                 |
|------------|--------|-----------------------------|
| `selector` | string | Selector for parent to get. |

##### Returns:

Returns matching parents.

Type  
[Faquery](Faquery.html)

#### parents(selector)

Get ancestors.

##### Parameters:

| Name       | Type   | Description                    |
|------------|--------|--------------------------------|
| `selector` | string | Selector for ancestors to get. |

##### Returns:

Returns matching ancestors.

Type  
[Faquery](Faquery.html)

#### prop(nameOrObject \[, value\])

Set/Get element properties. If first parameter is an object, this method
will set the properties in the keys to their respective values. If first
parameter is a string, and second parameter is not undefined, property
specified in first parameter will be set to value in second. If first
parameter is a string, and second parameter is undefined, function will
return existing property value.

##### Parameters:

| Name           | Type             | Argument     | Description                                                                                 |
|----------------|------------------|--------------|---------------------------------------------------------------------------------------------|
| `nameOrObject` | string \| object |              | Property name or an object with name-value pairs.                                           |
| `value`        | string           | \<optional\> | If supplied, will set the property whose name is specified in `nameOrObject` (if a string). |

##### Returns:

Returns itself if setting a property, or the property's value if getting
a property.

Type  
[Faquery](Faquery.html) \| string

#### remove(selector)

Remove elements from DOM that match a selector.

##### Parameters:

| Name       | Type   | Description              |
|------------|--------|--------------------------|
| `selector` | string | Query selector to match. |

##### Returns:

Returns itself.

Type  
[Faquery](Faquery.html)

#### removeAttr(attributes)

Remove HTML attributes.

##### Parameters:

| Name         | Type                       | Description                  |
|--------------|----------------------------|------------------------------|
| `attributes` | string \| Array.\<string\> | Attribute name(s) to remove. |

##### Returns:

Returns itself.

Type  
[Faquery](Faquery.html)

#### removeClass(classes)

Remove css classes.

##### Parameters:

| Name      | Type                       | Description                                          |
|-----------|----------------------------|------------------------------------------------------|
| `classes` | string \| Array.\<string\> | List of classes, either space delimited or an array. |

##### Returns:

Returns itself.

Type  
[Faquery](Faquery.html)

#### show()

Show DOM element(s). Display style is set to "block".

##### Returns:

Returns itself.

Type  
[Faquery](Faquery.html)

#### text( \[value\])

Set/Get inner text. If `value` not supplied, will return innerText.

##### Parameters:

| Name    | Type   | Argument     | Description                            |
|---------|--------|--------------|----------------------------------------|
| `value` | string | \<optional\> | If setting, value to set innerText to. |

##### Returns:

Returns itself if setting, or innerText if getting.

Type  
[Faquery](Faquery.html) \| string

#### val( \[value\])

Set/Get value property. If `value` not supplied, will return existing
`value` property value.

##### Parameters:

| Name    | Type   | Argument     | Description                                   |
|---------|--------|--------------|-----------------------------------------------|
| `value` | string | \<optional\> | If setting, value to set `value` property to. |

##### Returns:

Returns itself if setting, or value of `value` property if getting.

Type  
[Faquery](Faquery.html) \| string
