Good day I'm trying to showing a tooltip in multiple input fields inside. Here is my script.
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script>
$(document).ready(function(){
$(document).on("change",'#tooltip1val',function(){
$('.tooltip1').attr('title',$(this).val());
})
});
</script>
<table>
<tr>
<td>Tooltip 1<input data-toggle="tooltip" id="tooltip1val" type="text"></td>
</tr>
</table>
------------------
<table>
<tr>
<td>Result 1<input class="tooltip1"
type="text">
</td>
<td>Result 1<input class="tooltip1"
type="text">
</td>
</tr>
</table>
For now i'm only able to do it static
. So, what if i have multiple place to input the tooltip-title
& And i have multiple textfield(s) to use the tooltip?
example :
<table>
<?php for($x=0;$x<8;$x++){?>
<tr>
<td>Tooltip <?php echo $x;?><input id="tooltip1val" type="text"></td>
</tr>
<?php } ?>
</table>
------------------
<table>
<?php for($x=0;$x<8;$x++){?>
<tr>
<td>Result <?php echo $x;?><input data-toggle="tooltip" class="tooltip1"
type="text">
</td>
<td>Result <?php echo $x;?><input data-toggle="tooltip" class="tooltip1"
type="text">
</td>
<?php } ?>
</tr>
Thanks in advance and sorry for my bad english
</div>