how to put input in alert js code example
Example 1: how to add button in alert box in react native
Alert.alert(
'Alert Title',
'My Alert Msg',
[
{text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel',
},
{text: 'OK', onPress: () => console.log('OK Pressed')},
],
{cancelable: false},
);
Example 2: how to use text onclick to display images in javascript
$('img').click(function () {
if($(this).attr('id') == '1') {
$('#div').html('Image with 1 was clicked');
} else {
}
}