I am unable to use the execCommand('copy')
, trying to copy value which is selected in multi-select option. I am getting value in "temp" but the value which is getting in temp not copying or getting in clipboard.
{
$propArr=array_unique($properties);
echo "<div class='table-responsive'>";
echo "<table class='bordered'>";
foreach($propArr as $keyProp =>$val){
echo "<tr>";
echo "<td>$val</td><td>";
echo "<select name='propval' id='propval' onclick='showpropval(this.value);' class='form-control' multiple>";
foreach($values as $k => $v){
if($val==$k){
foreach($v as $kv =>$fval){
echo "<option value='$fval'>$fval</option>";
}
}
}
echo "</select>";
echo"</td>";
echo "</tr>";
}
echo "</table>";
echo "</div>";
}
<script>
function showpropval(val)
{
var temp = val;
temp.execCommand("copy");
}
</script>