ARKjs

A lightweight JavaScript library for easy DOM manipulation and styling

Getting Started

Installation

<script src=""></script>
npm install arkjs

Basic Usage

// Create a button
ARK.create('button')
  .text('Click me')
  .css({
    padding: '10px 20px',
    backgroundColor: '#4285f4',
    color: 'white'
  })
  .on('click', () => alert('Hello ARKjs!'))
  .appendTo('body');

Examples

Simple Element Creation

ARK.create('div')
  .text('Hello World!')
  .css({ color: 'red', fontSize: '24px' })
  .appendTo('#example1 .example-output');

Event Handling

ARK.create('button')
  .text('Click Me')
  .on('click', () => {
    ARK.create('p')
      .text('Button clicked!')
      .appendTo('#example2 .example-output');
  })
  .appendTo('#example2 .example-output');

API Reference

Method Description Example
ARK.create(tag, attributes) Creates a new element ARK.create('div', { id: 'box' })
.attr(key, value) Sets or gets attributes .attr('id', 'main')
.css(property, value) Sets or gets styles .css({ color: 'red' })
.text(content) Sets text content .text('Hello')
.appendTo(target) Appends to another element .appendTo('#container')
.on(event, handler) Adds event listener .on('click', handler)

Download