Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

alpinejs with select

// display selected value dynamically:
<div x-data="{ dynamictext: 'default' }">
  <select name="location_id"
		x-on:change="(e) => locationfull = e.target.options[e.target.selectedIndex].value">
          ...options
  </select>
  // display dynamic text:
  <span x-text="dynamictext"></span>
</div>
 
PREVIOUS NEXT
Tagged: #alpinejs #select
ADD COMMENT
Topic
Name
1+3 =