fix type check in Ox.$

This commit is contained in:
rolux 2012-05-19 12:15:28 +04:00
parent 49fc8dc8ed
commit 6acfd505e6

View file

@ -81,7 +81,7 @@ Ox.$ = Ox.element = function(val) {
// fixme: remove click and mousedown, // fixme: remove click and mousedown,
// add native css selector // add native css selector
// take all matches of getElementsBy... // take all matches of getElementsBy...
var element = Ox.isObject(val) ? val // window or document var element = !Ox.isString(val) ? val // window or document
: val[0] == '<' ? document.createElement(Ox.sub(val, 1, -1)) : val[0] == '<' ? document.createElement(Ox.sub(val, 1, -1))
: val[0] == '#' ? document.getElementById(Ox.sub(val, 1)) : val[0] == '#' ? document.getElementById(Ox.sub(val, 1))
: val[0] == '.' ? document.getElementsByClassName(Ox.sub(val, 1))[0] : val[0] == '.' ? document.getElementsByClassName(Ox.sub(val, 1))[0]