GithubHelp home page GithubHelp logo

asajs's Introduction

AsaJS

Java Script Library
Version: 0.4.8
Experimental version !
The library was made for the purpose of studying the work of javascript, and its work is similar to the jQuery library.
Methods are added to the prototype of the element, so the library may not be stable in the future.

Documentation mini




getEl() function

getEl(selectors)

Returns element or elements (if there are many).


NOTE

Once you use this command, new asaJS methods will be added to all these elements!


example

<div class="abcClass">Hello</div>
<div id="abcId">Hi</div>
getEl(".abcClass") // <div class="abcClass">Hello</div>
getEl("#abcId") // <div id="abcId">Hi</div>
getEl("div") // NodeList(2) [div.abcClass, div#abcId]


CSSinfo() method

element.CSSinfo()

Shows elements css information

example

const abc = getEl(".abcClass");

abc.CSSinfo().display    //block


css() method

Sets the css style.
With no arguments show css information.

example

//1.
element.css(property,value);
//2.
element.css({
    property:value,
    property:value,
    ...
})
//3.
element.css() // show css info


crEl() function / method

crEl(selector, attribute, callback);
element.crEl(selector, attribute, callback)
  • selector - HTML selector(string)
  • attribute - {attribute:value, ...} or set class or id(value)
  • callback - (function)

Create element, sets attribute, and executes a callback with the first argument, which is just the newly created element.
It can also be used as a method to add a new element to an already created element.


NOTE

Once you use this command, new asaJS methods will be added to all these elements!


example

//1.
const myDiv = crEl("div", {class:"newDiv"} (el)=> {
    console.log(el) // div.newDiv
})
console.log(myDiv) // div.newDiv

//2.
const myDiv2 = crEl("div", ".abcClass")
console.log(myDiv2) // div.abcClass

//3.
const myDiv3 = crEl("div", "#abcId")
console.log(myDiv3) // div#abcId

//4.
const abcEl = getEl(".abc");
abcEl.crEl("div", ".abcClass");

console.log(abcEl.children)    //HTMLCollection [div.abcClass]

asajs's People

Contributors

remxyz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.