jquery - Javascript $ notation -


this question has answer here:

please can explain javascript code does.

$('#element_id').html(response.title); 

i need access value of element_id can't using document.getelementbyid.

thanks

this code calls function named $ , access method of returned object.

it's jquery code due selector string.

  • $('#element_id'): returns jquery object element given id.
  • .html(response.title): sets inner html of dom element response.title.

the raw javascript this:

document.getelementbyid("element_id").innerhtml = response.title; 

Comments

Popular posts from this blog

c++ - list<myClass<int> * > sort -

Meteor app using NGINX as load balancer -

python - How to find the cumulative sum of numbers in a list? -