enltr xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#"http://www.w3.org/1999/xhtml/vocab/////////////////Get or Set values of input types using .val() method | BitsyCodehttps://www.bitsycode.com/methods/dom/valGet or Set values of input types using .val() method | BitsyCode Get or Set values of input types using .val() method | BitsyCode html not-front not-logged-in no-sidebars page-node page-node- page-node-52 node-type-page

Get or Set values of input types using .val() method



Description: Get the value for the first input type element specified or you can set one or more values for all matched elements.


<!doctype html>
    <html lang="en">
      <meta charset="utf-8">
      <title>val demo</title>
      <script src="http://code.bitsycode.com/bitsycode-latest.min.js"></script>
      <b>Input element value set</b><br />
      <input type="text" name="inputField" class="inputField" value="" /><br /><br />
      <b>Retrieved input value</b><br />
      <div class="result"></div>
            bitsyCode(".inputField").val("This was added from BitsyCode"); //SET VALUE
            var result = bitsyCode(".inputField").val(); //RETRIEVE VALUE


Input element value set

Retrieved input value
This was added from BitsyCode

Developed and built with passion and commitment.
Maintained by the bitsycode team.