title: get input value using data-attribute with jquery
body: <p>How can i get the input value using data-attributes with jQuery? This is my function which is not working. the return value of valuefromscenariotwo should be "My test 2"  </p>
  
  <pre><code>var valuefromscenariotwo = getvaluefromScenariotwo("scenario2");
  function getvaluefromScenariotwo(name){
    return $(input[data-scenario=name]).val();
  }
  
  &lt;div class="form-group"&gt;
  &lt;input type="text" data-scenario="scenario1" class="form-control notes" placeholder="Enter Notes"           value="My test 1"&gt;
  &lt;/div&gt;;
  &lt;div class="form-group"&gt;
  &lt;input type="text" data-scenario="scenario2" class="form-control notes" placeholder="Enter Notes"   value="My test 2"&gt;
  &lt;/div&gt;;
  &lt;div class="form-group"&gt;
  &lt;input type="text" data-scenario="scenario3" class="form-control notes" placeholder="Enter Notes"   value="My test 3"&gt;
  &lt;/div&gt;;
  </code></pre>