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

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -