How would I write a function to pass an object's Name or ID to a widget's options?

How would I write a function to pass an object's Name or ID to a widget's options?

How would I write a function to pass an object's Name or ID to a widget's options?

I am using the jQuery UI MultiSelect Widget and want to set noneSelectedText to equal the object's Name (and/or ID or Title).

I understand that the method for doing this is by calling $(this).attr("id"); but haven't been able to figure out the correct way to add that to my code.


Script for assigning the widget's options
(It's currently set it to call by Class instead of ID because I have close to 100 dropdowns).
  1. $(function(){
  2.     $(".multi").multiselect({
  3.    selectedList: 4,
  4.    multiple: true,
  5.    noneSelectedText: 'Dropdown Name',
  6.   }) 
  7. });

HTML for Multiselect Dropdown
  1.  <select class="multi" name="example" id="example" multiple="multiple">
  2. <option value="1">Option 1</option>
  3. <option value="2">Option 2</option>
  4. <option value="3">Option 3</option>
  5. <option value="4">Option 4</option>
  6. <option value="5">Option 5</option>
  7. </select>