Am tot vazut in diverse coduri urmatoarele variabile:
Cod: Selectaţi tot
var text=..
var $text=..
var _text=..
Daca stiti sa explicati si sa dati exemple.
Astept raspuns.
Cu stima Trif
Cod: Selectaţi tot
var text=..
var $text=..
var _text=..
Cod: Selectaţi tot
function className(){
var obj ={};
//set property:value in obj
function $obj(p, v){
obj[p] = v;
}
//get property value from obj
function _obj(p){
return obj[p];
}
}
Cod: Selectaţi tot
function className(){
//return element by id
function $(id){
return document.getElementById(id);
}
//return element by selector (sel)
function _(sel){
return document.querySelector(sel);
}
//using $() si _(), for a more simply and short code
var methodName = function(){
var e1 = $('id1');
var e2 = $('id2');
var es1 = _('#id1 .class');
var es2 = _('#id2 .class');
//...
}
}